#34237: FileField does not take upload_to into account when setting unique=True
-------------------------------------+-------------------------------------
Reporter: 0x4A-0x41-0x4B | Owner: nobody
Type: Bug | Status: new
Component: File | Version: 4.1
uploads/storage |
Severity: Normal | Resolution:
Keywords: FileField, Unique, | Triage Stage:
Storage, Upload | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by 0x4A-0x41-0x4B:
Old description:
> #27188 added support for setting unique=True for the FileField.
> This does not seem to take the upload_to argument into account.
>
> As upload_to could be used to completely change the name of the uploaded
> file it should, in my opinion, be considered part of the filename.
> Or should at the very least be mentioned in the docs for clarity.
>
> If upload_to is defined, setting unique=True does effectively nothing
> right now. The file is passed on and a unique filename is generated
> (->The default behavior of adding an underscore followed by seven random
> characters) instead of raising an error.
New description:
#27188 added support for setting unique=True to the FileField.
This does not seem to take the upload_to argument into account.
As upload_to could be used to completely change the name of the uploaded
file it should, in my opinion, be considered part of the filename.
Or should at the very least be mentioned in the docs for clarity.
If upload_to is defined, setting unique=True does effectively nothing
right now. The file is passed on and a unique filename is generated (->The
default behavior of adding an underscore followed by seven random
characters) instead of raising an error.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/34237#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018568844cb3-a7cc44ab-e046-4ea4-ad78-b2d1c2dba4ea-000000%40eu-central-1.amazonses.com.