Commit 4bf7ba24 authored by Romain Courteaud's avatar Romain Courteaud

Formulator: option value should not be an empty string

parent 87c0f2c1
......@@ -1156,10 +1156,14 @@ class ListWidget(SingleItemsWidget):
return "\n".join([list_widget, input_hidden])
def render_item(self, text, value, key, css_class, extra_item):
if not text:
text = ' '
return self.render_element('option', contents=text, value=value,
extra=extra_item)
def render_selected_item(self, text, value, key, css_class, extra_item):
if not text:
text = ' '
return self.render_element('option', contents=text, value=value,
selected=None, extra=extra_item)
......@@ -1195,10 +1199,14 @@ class MultiListWidget(MultiItemsWidget):
return "\n".join([multi_list,input_hidden])
def render_item(self, text, value, key, css_class, extra_item):
if not text:
text = ' '
return self.render_element('option', contents=text, value=value,
extra=extra_item)
def render_selected_item(self, text, value, key, css_class, extra_item):
if not text:
text = ' '
return self.render_element('option', contents=text, value=value,
selected=None, extra=extra_item)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment