'ClearableFileInput' object has no attribute 'value'

Issue #8 resolved
Anonymous created an issue

the error is produced while rendering a form bound with POST data (since the form has errors it is being rendered again)

since the decompress method is not called in this case value is not defined on self and the line 72 if self.value: is throwing error.

possible fix might be changing line 72 to if hasattr(self, 'value') and self.value:

wonder this kind of error is not being reported till now, am I missing something here ??

Comments (4)

  1. Carl Meyer repo owner

    No, this was not 1.2 specific, it's always been an issue. It is surprising (not to mention embarrassing) that I never found it: must have just never had a form redisplay that included a ClearableFileField. Thanks for the report; should be fixed here: c0ab59fc91d3

    While working on this, I uncovered another issue with ClearableFileField and form redisplay. It's not a showstopper, but it's kind of irritating. Described in 0b3f1fc99189 and this Django ticket: http://code.djangoproject.com/ticket/14039.

  2. Log in to comment