FileField path url dumpdata/loaddata issue
|Reported by:||Ian Ward||Owned by:||nobody|
|Severity:||Keywords:||FileField path url|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have a model that includes a FileField with values such as "/media/uploaded/YEAR/MONTH/NAME" (upload_to='%Y/%m').
I upgraded to Django 1.0 beta svn-8457 and switched from using get_filefiledname_size() to filefiedname.size.
Now, this property triggers a SuspiciousOperation exception: When django.core.files.storage.FileSystemStorage.path is called,
it calls safe_join and decides that the leading slash in the file path puts the file outside of the media root directory.
New instances of this model include a leading slash in the path, so this doesn't seem to be a change
to how the file name is stored.
Change History (4)
comment:1 Changed 7 years ago by Ian Ward
- Component changed from File uploads/storage to Serialization
- Keywords path url added; size removed
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Summary changed from FileField.size triggering SuspiciousOperation exception to FileField path url dumpdata/loaddata issue
comment:3 Changed 7 years ago by Ian Ward
- Resolution set to worksforme
- Status changed from new to closed