#2413: FileField edit_inline broken
-----------------------------+----------------------------------------------
Reporter: Gacha | Owner: adrian
Type: defect | Status: reopened
Priority: highest | Milestone:
Component: Admin interface | Version: SVN
Severity: critical | Resolution:
Keywords: |
-----------------------------+----------------------------------------------
Comment (by Joel Heenan <[EMAIL PROTECTED]>):
Ok so I investigated this and there were a number of issues. The most
glaring is that manipulators can set all_cores_given=True and
all_cores_blank=True at the same time in django/db/models/manipulators
around line 169. I'm not sure why two variables were used here when one
would suffice given that the code says that if some but not all were given
that would cause an earlier error. So that caused some nasty bugs where
files were added then deleted again.
The second issue I found was that there is currently no checking for file
type fields that are core. I added a new function for this purpose but its
a bit of a hack. This check had the (good) side-effect of elimating these
weird invalid objects that were being created from blank files.
I've made a patch that appears to me to fix the error you have
encountered. I fiddled with the admin interface and I ran the included
tests and it doesn't appear to have broken anything else that I can see -
but I would imagine there are other corner cases around files like this
one. Ideally we could do away with the hack of treating files so
differently and have a better way of discovering whether they are provided
or not - e.g. fields could return whether they are to be deleted or not?
There should not be any field specific code inside the manipulators.
Disclaimer: this patch appears to work for me, don't apply it on anything
you care about
--
Ticket URL: <http://code.djangoproject.com/ticket/2413>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---