Commit dd28906d authored by Jérome Perrin's avatar Jérome Perrin

use getTranslatedMessage to display the constraint message in account workflow validation failures

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14745 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6261b64d
......@@ -74,10 +74,16 @@ from Products.ERP5Type.Message import Message\n
account = sci[\'object\']\n
N_ = lambda msgid: Message(\'erp5_ui\', msgid)\n
\n
# TODO: use constraint for this\n
if not account.getGap():\n
raise ValidationFailed(N_("GAP is unset."))\n
\n
for err in account.checkConsistency():\n
if hasattr(err, \'getTranslatedMessage\'):\n
raise ValidationFailed(err.getTranslatedMessage())\n
# Old constraints implementation doesn\'t have a translated message,\n
# in this case, simply translate the description of the constraint in\n
# the property sheet.\n
raise ValidationFailed(N_(err[4]))\n
</string> </value>
</item>
......@@ -132,6 +138,7 @@ for err in account.checkConsistency():\n
<string>_getattr_</string>
<string>_getiter_</string>
<string>err</string>
<string>hasattr</string>
</tuple>
</value>
</item>
......
325
\ No newline at end of file
327
\ No newline at end of file
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