Commit 96c2aefe authored by wenjie.zheng's avatar wenjie.zheng

Workflow.py: check before script type before execution.

parent 36226d6b
...@@ -616,8 +616,9 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -616,8 +616,9 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if script_id: if script_id:
script = self._getOb(script_id, None) script = self._getOb(script_id, None)
# Pass lots of info to the script in a single parameter. # Pass lots of info to the script in a single parameter.
kwargs = form_kw if script.getTypeInfo().getId() == 'Workflow Script':
sci = StateChangeInfo( kwargs = form_kw
sci = StateChangeInfo(
document, self, former_status, tdef, old_sdef, new_sdef, kwargs) document, self, former_status, tdef, old_sdef, new_sdef, kwargs)
try: try:
script(sci) # May throw an exception. script(sci) # May throw an exception.
......
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