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