Opened 10 years ago

Closed 9 years ago

#412 closed defect (fixed)

FileField bug

Reported by: Dagur Owned by: adrian
Component: Database layer (models, ORM) Version:
Severity: minor Keywords: FileField Upload
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I get this error: When I try to create a new message with an attachment. But still the object is created and the file seems to be added to my media directory.

However, if I create the message first and then edit it, adding the attachment, I get no errors and no problems.

The model validates and I'm using revision 547.
here is my model:

Change History (3)

comment:1 Changed 10 years ago by Boffbowsh

My initial attempt to fix it is here, but this brought up this error when Dagur tried to edit it in admin

comment:2 Changed 10 years ago by Dagur

Changing the pre_save method in django/core/meta/ to this did the trick (and as far as I can see it doesn't break anything):

    def pre_save(self, value, add):
        if self.auto_now or (self.auto_now_add and add) or value=='':
        return value

comment:3 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

I assume this is fixed by now, so I'm closing...

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