fields: don't crash storing items field if there's no options (#40536)

This commit is contained in:
Frédéric Péters 2020-03-09 11:25:50 +01:00
parent 789cf1a53d
commit e3c5b3be9b
1 changed files with 2 additions and 1 deletions

View File

@ -1704,8 +1704,9 @@ class ItemsField(WidgetField):
return values
def store_display_value(self, data, field_id):
kwargs = {}
options = self.get_options()
if not options:
return ''
choices = []
for choice in data.get(field_id) or []:
if type(options[0]) is str: