Sure, here you go: https://code.djangoproject.com/ticket/19215
On Tuesday, October 30, 2012 12:01:15 PM UTC-6, Carl Meyer wrote: > > Hi Nick, > > On 10/30/2012 08:21 AM, Nick wrote: > > I posted this question to Stack Overflow a couple weeks ago (link > > < > http://stackoverflow.com/questions/12902785/imagefields-currently-and-clear-sometimes-doesnt-appear>) > > > > but have had no responses. I'm guessing it's geared more towards the > > Django developers, so I'm going to post it here. > > > > Assume you have a model that has a required field of any type and also > > an optional ImageField. Let's say you used Django's built-in admin > > interface to insert a row into this database table and when you did so, > > you filled out both fields. Now let's say you go to edit the row that > > you just created. The ImageField will look like this: > > > > Currently: [url] | [checkbox] Clear > > > > Change: [file widget] > > > > If you upload a non-image (a PDF, for example), it will say "Upload a > > valid image. The file you uploaded was either not an image or a > > corrupted image." only now the "Currently: [url] | [checkbox] Clear" > > portion won't be there anymore. This can be misleading to users (causing > > them to think the original image is now gone). > > > > Another issue is let's say you were editing the row and you blanked out > > the required field and also replaced the image with another one. It > > will, of course, complain about the required field not being filled out. > > But, again, the "Currently: [url] | [checkbox] Clear" portion of the > > image field won't be there anymore. Again, this can mislead the user. > > > > Is this a bug or is this the intended behavior? Either way, how can I > > get around this? > > I can reproduce this, and I'd call it a bug. I think the fix may involve > passing the "initial" value to the ClearableFileInput in preference to > the value from the form submission, in cases where a bound form is being > rendered (because the ClearableFileInput widget can't do anything useful > with an unsaved value anyway), but it's not immediately clear to me how > to do that without introducing some unsavory widget-type-checking into > BoundField. So I think the right fix here may take some thought. > > I searched the bug-tracker at code.djangoproject.com and didn't find an > existing bug for this - do you mind filing a bug for it? > > Thanks! > > Carl > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/YH--EYtHydIJ. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.