Commit 8119ab80 authored by Julien Muchembled's avatar Julien Muchembled

A workflow method should raise an exception when it is invoked from a workflow...

A workflow method should raise an exception when it is invoked from a workflow state which does  not support it or whenever guards reject it. Add log for the moment.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26916 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 21154705
......@@ -199,8 +199,15 @@ class WorkflowMethod(Method):
valid_transition_item_list = []
for wf_id, transition_list in candidate_transition_item_list:
candidate_workflow = wf[wf_id]
valid_list = [transition_id for transition_id in transition_list
if candidate_workflow.isWorkflowMethodSupported(instance, transition_id)]
valid_list = []
for transition_id in transition_list:
if candidate_workflow.isWorkflowMethodSupported(instance, transition_id):
valid_list.append(transition_id)
else:
LOG("WorkflowMethod.__call__", ERROR,
"Transition %s/%s on %r is ignored. Current state is %r."
% (wf_id, transition_id, instance,
candidate_workflow._getWorkflowStateOf(instance, id_only=1)))
if valid_list:
valid_transition_item_list.append((wf_id, valid_list))
......
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