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):
# user if any. However, it's only possible if keys are unique,
# so this is skipped if there's no uid.
# This duplicates some work done by field.render
field_key = editable_field.generate_field_key(key=key)
try:
display_value = editable_field._get_user_input_value(
editable_field.generate_field_key(key=key), request)
field_key, request)
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,
Widget.MultiItemsWidget) and \
not isinstance(display_value, list):
......
  • @kazuhiko, instead of this and 688420f8 fixups for 8af1da02, maybe it makes more sense to file initial patch for review, give it some time to settle and only then push to master?

    Even reviewing yourself after some time with fresh eye helps sometimes...

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