Commit 35ce2420 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Fix simple mistakes in the previous change.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@511 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f486547d
......@@ -510,6 +510,7 @@ class ERP5DCWorkflowDefinition (DCWorkflowDefinition):
sci = StateChangeInfo(
ob, self, former_status, tdef, old_sdef, new_sdef, kwargs)
try:
LOG('_executeTransition', 0, "script = %s, sci = %s" % (repr(script), repr(sci)))
script(sci) # May throw an exception.
except ValidationFailed, validation_exc:
before_script_success = 0
......@@ -568,15 +569,20 @@ class ERP5DCWorkflowDefinition (DCWorkflowDefinition):
tool = aq_parent(aq_inner(self))
tool.setStatusOf(self.id, ob, status)
# Make sure that the error message is empty.
sci = StateChangeInfo(
ob, self, status, tdef, old_sdef, new_sdef, kwargs)
sci.setWorkflowVariable(ob, error_message = '')
# Update role to permission assignments.
self.updateRoleMappingsFor(ob)
# Execute the "after" script.
if tdef is not None and tdef.after_script_name:
# Script can be either script or workflow method
if after_script_name in filter(lambda k: self.transitions[k].trigger_type == TRIGGER_WORKFLOW_METHOD,
new_sdef.transitions.keys()):
script = getattr(ob, after_script_name)
if tdef.after_script_name in filter(lambda k: self.transitions[k].trigger_type == TRIGGER_WORKFLOW_METHOD,
new_sdef.transitions):
script = getattr(ob, tdef.after_script_name)
script()
else:
script = self.scripts[tdef.after_script_name]
......
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