fields: fix calculation of first element length in item field
This commit is contained in:
parent
8137ebd93a
commit
d9ad5b0e66
|
@ -684,7 +684,11 @@ class ItemField(WidgetField):
|
|||
kwargs['options'] = [(None, '---')]
|
||||
if self.show_as_radio:
|
||||
self.widget_class = RadiobuttonsWidget
|
||||
if len(kwargs['options']) > 3 or len(kwargs['options'][0][1]) > 10:
|
||||
if type(kwargs['options'][0]) is str:
|
||||
first_item = kwargs['options'][0]
|
||||
else:
|
||||
first_item = kwargs['options'][0][1]
|
||||
if len(kwargs['options']) > 3 or len(first_item) > 10:
|
||||
# TODO: absence/presence of delimitor should be an option
|
||||
kwargs['delim'] = htmltext('<br />')
|
||||
|
||||
|
|
Loading…
Reference in New Issue