- changed status to open
'ClearableFileInput' object has no attribute 'value'
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)
-
-
I remember facing similar issue in django 1.1 also, but i just ignored it that time
PS: I am the OP
-
- changed status to resolved
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.
-
Thank you for the fix.
- Log in to comment
It's possible it's a Django 1.2 issue? I haven't used ClearableFileInput yet on 1.2. I'll look into it.