Commit 4e12f94c authored by Georgios Dagkakis's avatar Georgios Dagkakis

erp5_hal_json_style: Make sure that field error messages are translated

in case the message is defined in the field ('manage_messagesForm' tab)
parent 8ba9a1e2
......@@ -1042,7 +1042,7 @@ def renderForm(traversed_document, form, response_dict, key_prefix=None, selecti
try:
response_dict[field.id] = renderField(traversed_document, field, form, key_prefix=key_prefix, selection_params=selection_params, request_field=not use_relation_form_page_template)
if field_errors.has_key(field.id):
response_dict[field.id]["error_text"] = field_errors[field.id].error_text
response_dict[field.id]["error_text"] = field_errors[field.id].getMessage(Base_translateString)
except AttributeError as error:
# Do not crash if field configuration is wrong.
log("Field {} rendering failed because of {!s}".format(field.id, error), level=800)
......
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