Commit 19c92726 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! ListBox: support rendering empty item as user's input in multi item...

fixup! ListBox: support rendering empty item as user's input in multi item widget having default values.
parent 688420f8
...@@ -2456,11 +2456,15 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine): ...@@ -2456,11 +2456,15 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
# user if any. However, it's only possible if keys are unique, # user if any. However, it's only possible if keys are unique,
# so this is skipped if there's no uid. # so this is skipped if there's no uid.
# This duplicates some work done by field.render # This duplicates some work done by field.render
field_key = editable_field.generate_field_key(key=key)
try: try:
display_value = editable_field._get_user_input_value( display_value = editable_field._get_user_input_value(
editable_field.generate_field_key(key=key), request) field_key, request)
except (KeyError, AttributeError): except (KeyError, AttributeError):
display_value = original_value if request.get('default_' + field_key) is None:
display_value = original_value
else:
display_value = None
if isinstance(editable_field.getRecursiveTemplateField().widget, if isinstance(editable_field.getRecursiveTemplateField().widget,
Widget.MultiItemsWidget) and \ Widget.MultiItemsWidget) and \
not isinstance(display_value, list): not isinstance(display_value, list):
......
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