Commit 27e969d3 authored by Ivan Tyagov's avatar Ivan Tyagov

Implement consistency checks using dfault script API.

Allow to close a draft position.
parent 5ae77b41
...@@ -50,22 +50,8 @@ ...@@ -50,22 +50,8 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>state_change[\'object\'].Base_checkConsistency()\n
</string> </value>
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
check_type = N_(check_result[0][-1])\n
# TODO: use nice url encoding method there instead of replace()\n
check_details = check_result[0][-2].replace(\'<\', \'&lt;\').replace(\'>\', \'&gt;\')\n
raise ValidationFailed, "%s : %s" % (check_type, check_details)\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
<value> <value>
<tuple> <tuple>
<string>close</string>
<string>close_action</string>
<string>delete</string> <string>delete</string>
<string>delete_action</string> <string>delete_action</string>
<string>open</string> <string>open</string>
......
18 19
\ 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