#1858 closed defect (fixed)
[patch] typo in get_FOO_size
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| 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: | no | UI/UX: | no |
Description
the magic accessor to get the size of an uploaded file is broken. Trivial patch.
Attachments (1)
Change History (3)
by , 19 years ago
| Attachment: | get_file_size.diff added |
|---|
comment:1 by , 19 years ago
comment:2 by , 19 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
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.