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

Call the generic script Base_checkConsistency, which deals properly with...

Call the generic script Base_checkConsistency, which deals properly with translation of ValidationFailed

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19305 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c50baab4
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -68,19 +65,8 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
object = state_change[\'object\']\n
N_ = object.Base_translateString\n
\n
check_result = object.checkConsistency()\n
\n
if len(check_result) > 0:\n
raise ValidationFailed, N_(check_result[0][-1])\n
]]></string> </value>
<value> <string>state_change[\'object\'].Base_checkConsistency()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -123,14 +109,8 @@ if len(check_result) > 0:\n
<value>
<tuple>
<string>state_change</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>_getitem_</string>
<string>object</string>
<string>_getattr_</string>
<string>N_</string>
<string>check_result</string>
<string>len</string>
<string>_getitem_</string>
</tuple>
</value>
</item>
......
147
\ No newline at end of file
148
\ No newline at end of file
......@@ -65,23 +65,8 @@
</item>
<item>
<key> <string>_body</string> </key>
<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
object = state_change[\'object\']\n
result = object.checkConsistency()\n
if result:\n
message= \'The document is not valid:<br/>\'\n
message += \'<br/>\'.join(\'- \' + str(r.message) for r in result)\n
raise ValidationFailed(message)\n
]]></string> </value>
<value> <string>state_change[\'object\'].Base_checkConsistency()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -124,15 +109,8 @@ if result:\n
<value>
<tuple>
<string>state_change</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>_getitem_</string>
<string>object</string>
<string>_getattr_</string>
<string>result</string>
<string>message</string>
<string>_inplacevar_</string>
<string>_getiter_</string>
<string>_getitem_</string>
</tuple>
</value>
</item>
......
844
\ No newline at end of file
845
\ 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