fix handling of attribute_name in PreviewDoc
This commit is contained in:
parent
65c40ac744
commit
fc5e626e8f
|
@ -421,7 +421,7 @@ class PreviewDoc(Field):
|
|||
implements(IPreviewDoc, IFromUnicode)
|
||||
|
||||
def __init__(self, **kw):
|
||||
for attr in ('height', 'width'):
|
||||
for attr in ('height', 'width', 'attribute_name'):
|
||||
if kw.get(attr):
|
||||
setattr(self, attr, kw.get('attr'))
|
||||
if attr in kw:
|
||||
|
|
|
@ -422,7 +422,7 @@ class PreviewDocWidget(Widget):
|
|||
return u'100px'
|
||||
|
||||
def get_attribute_name(self):
|
||||
if hasattr(self.field, 'attribute_name'):
|
||||
if hasattr(self.field, 'attribute_name') and self.field.attribute_name:
|
||||
return self.field.attribute_name
|
||||
else:
|
||||
return 'fichier'
|
||||
|
|
Reference in New Issue