do not fail if the data source returns nothing

This commit is contained in:
Frédéric Péters 2012-05-26 08:27:22 +02:00
parent 73eb9d70ac
commit 1c89899b90
1 changed files with 1 additions and 1 deletions

View File

@ -663,7 +663,7 @@ class ItemField(WidgetField):
kwargs['options'] = data_sources.get_items(self.data_source)
elif self.items:
kwargs['options'] = self.items
else:
if not kwargs.get('options'):
kwargs['options'] = [(None, '---')]
if self.show_as_radio:
self.widget_class = RadiobuttonsWidget