Code

Opened 6 years ago

Closed 6 years ago

#7144 closed (invalid)

FileField joins MEDIA_ROOT with FileDict

Reported by: cpinto Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The _get_FIELD_filename function in Model class joins MEDIA_ROOT with the FIELD's value, which is, apparently a FileDict. If I get the filename value out of the dict, the function appears to work properly. Below is a sample error:

  File "/home/cpinto/programs/python/django/db/models/base.py", line 436, in _get_FIELD_filename
    return os.path.join(settings.MEDIA_ROOT, getattr(self, field.attname))
  File "/usr/lib/python2.5/posixpath.py", line 60, in join
    if b.startswith('/'):
AttributeError: 'FileDict' object has no attribute 'startswith'

The proposed patch should fix this.

Attachments (1)

filefield_get_field_filename.patch (643 bytes) - added by cpinto 6 years ago.

Download all attachments as: .zip

Change History (2)

Changed 6 years ago by cpinto

comment:1 Changed 6 years ago by cpinto

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.