Commit 617d19ac authored by Bartek Górny's avatar Bartek Górny

correct format of validation failed exception message

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12535 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent df19f47b
......@@ -68,22 +68,27 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
<value> <string encoding="cdata"><![CDATA[
"""\n
called before submit to check if it is ok\n
otherwise set a special variable and raise validation exception\n
"""\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n
ob=state_change.object\n
\n
res = ob.checkConsistency()\n
if res:\n
msg = str(res)\n
state_change.new_state.addVariable(\'consistency_state\', \'missing\')\n
msg= \'The document is not consistent:<br/>\'\n
msg += \'<br/>\'.join(\'- \' + str(r.message) for r in res)\n
#state_change.kwargs.set(\'consistency_state\',\'missing\')\n
raise ValidationFailed(msg)\n
else:\n
state_change.new_state.addVariable(\'consistency_state\', \'good\')\n
</string> </value>
pass\n
#state_change.kwargs.set(\'consistency_state\',\'good\')\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -131,7 +136,6 @@ else:\n
<string>_getattr_</string>
<string>ob</string>
<string>res</string>
<string>str</string>
<string>msg</string>
</tuple>
</value>
......
490
\ No newline at end of file
492
\ 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