ItemField: fix crash when data_source returns less than 3 items
This commit is contained in:
parent
92256ef02d
commit
dbc3c9d79f
|
@ -684,7 +684,7 @@ class ItemField(WidgetField):
|
|||
kwargs['options'] = [(None, '---')]
|
||||
if self.show_as_radio:
|
||||
self.widget_class = RadiobuttonsWidget
|
||||
if len(kwargs['options']) > 3 or len(self.items[0]) > 10:
|
||||
if len(kwargs['options']) > 3 or len(kwargs['options'][0][1]) > 10:
|
||||
# TODO: absence/presence of delimitor should be an option
|
||||
kwargs['delim'] = htmltext('<br />')
|
||||
|
||||
|
|
Loading…
Reference in New Issue