Commit ef56caad authored by Nicolas Dumazet's avatar Nicolas Dumazet

The guard is already checked once using isWorkflowMethodSupported, and

notify* methods are never called if the guard evaluates to False. This
check looks costly and useless.


The only possibility (?) would be that one of your Interaction workflow guards
checks kw['workflow_method_args'] and returns a different result depending
on when _checkTransitionGuard is called.
That seems like a tricky (wrong? unlikely?) usecase.
If you are in this case, let me know, and if needed I'll engineer a fast guard
check that is only ever checked once.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42725 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b192815c
......@@ -220,8 +220,7 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
tdef = self.interactions[t_id]
assert tdef.trigger_type == TRIGGER_WORKFLOW_METHOD
if (tdef.portal_type_filter is None or \
ob.getPortalType() in tdef.portal_type_filter) and \
self._checkTransitionGuard(tdef, ob, **kw):
ob.getPortalType() in tdef.portal_type_filter):
filtered_transition_list.append(tdef.id)
former_status = self._getStatusOf(ob)
# Execute the "before" script.
......
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