Commit f1846727 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_hal_json_style: translate error messages of form fields

parent f95f28a8
...@@ -1089,7 +1089,7 @@ def renderForm(traversed_document, form, response_dict, key_prefix=None, selecti ...@@ -1089,7 +1089,7 @@ def renderForm(traversed_document, form, response_dict, key_prefix=None, selecti
try: try:
response_dict[field.id] = renderField(traversed_document, field, form, key_prefix=key_prefix, selection_params=selection_params) response_dict[field.id] = renderField(traversed_document, field, form, key_prefix=key_prefix, selection_params=selection_params)
if field_errors.has_key(field.id): 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"] = Base_translateString(field_errors[field.id].error_text)
except AttributeError as error: except AttributeError as error:
# Do not crash if field configuration is wrong. # Do not crash if field configuration is wrong.
log("Field {} rendering failed because of {!s}".format(field.id, error), level=800) 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