Commit 3c06c51d authored by Vincent Pelletier's avatar Vincent Pelletier

Allow error object to contain a mapping, to support error messages with...

Allow error object to contain a mapping, to support error messages with variable parts without flooding Localizer.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22642 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f14129a6
......@@ -2127,8 +2127,14 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
error_text = error_dict[key].error_text
error_text = cgi.escape(error_text)
if isinstance(error_text, str):
error_text = u'%s' % Message(domain=ui_domain,
message=error_text)
error_mapping = getattr(error_dict[key], 'error_mapping', None)
if error_mapping is not None:
error_text = u'%s' % Message(domain=ui_domain,
message=error_text,
mapping=error_mapping)
else:
error_text = u'%s' % Message(domain=ui_domain,
message=error_text)
error_message = u'<br />' + error_text
else:
error_message = u''
......
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