Opened 15 years ago

Last modified 15 years ago

#10179 closed

admin broken on FileField with blank=True — at Version 2

Reported by: malte Owned by: nobody
Component: Core (Management commands) Version: 1.0
Severity: Keywords: admin filefield bug
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Ramiro Morales)

If you have a FileField declared like so:

image_1 = models.FileField(upload_to=get_image_path, null=True, blank=True)

Then in django admin, the field becomes voluntary as it should. If you save a file in an optional field that works as expected. But if you come back to the item in the admin, and just hit 'save' without touching the optional file that is uploaded, the db record gets updated with a blank value for the FileField, effectively killing the connection with the file.

I'm using Sqlite, may make a difference here I suppose.

Change History (2)

comment:1 by Alex Gaynor, 15 years ago

I'm guessing this is a consequence of the file assignment stuff from a week or two ago.

comment:2 by Ramiro Morales, 15 years ago

Description: modified (diff)

(reformatted description)

malte: What version of Django are you using? If youa re using a revision from trunk latter that r9766, can you please try with r9765 and report back?

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