misc: don't fail on prefill attributes on titles in blocks (#45262)

This commit is contained in:
Frédéric Péters 2020-07-20 10:17:35 +02:00
parent 40c95ea3e4
commit 62092e89e7
2 changed files with 5 additions and 1 deletions

View File

@ -216,7 +216,9 @@ class BlockSubWidget(CompositeWidget):
field.add_to_view_form(form=self, value=field_value)
else:
field.add_to_form(form=self)
self.get_widget('f%s' % field.id).prefill_attributes = field.get_prefill_attributes()
widget = self.get_widget('f%s' % field.id)
if widget:
widget.prefill_attributes = field.get_prefill_attributes()
if value:
self.set_value(value)

View File

@ -410,6 +410,8 @@ class Field(object):
return (None, False)
def get_prefill_attributes(self):
if not self.prefill:
return
t = self.prefill.get('type')
if t == 'geolocation':