#34237: FileField does not take upload_to into account when setting unique=True
-------------------------------------+-------------------------------------
Reporter: 0x4A- | Owner: nobody
0x41-0x4B |
Type: Bug | Status: new
Component: File | Version: 4.1
uploads/storage | Keywords: FileField, Unique,
Severity: Normal | Storage, Upload
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
#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.
--
Ticket URL: <https://code.djangoproject.com/ticket/34237>
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/0107018568827966-43efb12f-7094-43c7-a742-66c0ec1aa043-000000%40eu-central-1.amazonses.com.