Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1858 closed defect (fixed)

[patch] typo in get_FOO_size

Reported by: tom@… Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

the magic accessor to get the size of an uploaded file is broken. Trivial patch.

Attachments (1)

get_file_size.diff (514 bytes) - added by tom@… 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by tom@…

comment:1 Changed 9 years ago by tom@…

Sorry, I did't really demonstrate the problem. The magic 'get_FOO_size' accessor is broken. A call to 'get_file_size' in a test model throws

  File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/utils/functional.py", line 3, in _curried
    return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))
  File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/db/models/base.py", line 301, in _get_FIELD_size
    return os.path.getsize(self.__get_FIELD_filename(field))
AttributeError: 'Upload' object has no attribute '_Model__get_FIELD_filename'

I'd like to test this case, but I presume this will require a writable MEDIA_ROOT for the test suite, which seems like a large requirement to me.

comment:2 Changed 9 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [2903]) Fixed #1858 : typo in get_FIELD_size() method. Thanks, tom@….

Note: See TracTickets for help on using tickets.
Back to Top