django-angular icon indicating copy to clipboard operation
django-angular copied to clipboard

'unicode' object has no attribute 'url'

Open nikolaysm opened this issue 7 years ago • 3 comments

Dear,

I get error if i do post and the form has been filled out incorrectly. On line 163 in djng/forms/widgets.py.

'unicode' object has no attribute 'url' Value is "u'Drop image here or click to upload" but must be None because imagefield was empty

nikolaysm avatar Apr 05 '18 09:04 nikolaysm

Django version?

jrief avatar Apr 05 '18 09:04 jrief

django== 1.11

nikolaysm avatar Apr 05 '18 10:04 nikolaysm

It can be fixed by checking for unicode?

if not isinstance(value, unicode) and value:
    ...

That is not a good solution, because it seems that imagefield is empty.

nikolaysm avatar Apr 05 '18 13:04 nikolaysm