Commit f8b19992 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[wf] new .workflow property on states and transitions

branch : 3.5
parent 3dfe497e5afa
......@@ -128,6 +128,10 @@ class BaseTransition(AnyEntity):
raise Exception('should not be instantiated')
super(BaseTransition, self).__init__(*args, **kwargs)
def workflow(self):
return self.transition_of[0]
def may_be_fired(self, eid):
"""return true if the logged user may fire this transition
......@@ -218,6 +222,10 @@ class State(AnyEntity):
fetch_attrs, fetch_order = fetch_config(['name'])
rest_attr = 'eid'
def workflow(self):
return self.state_of[0]
def after_deletion_path(self):
"""return (path, parameters) which should be used as redirect
information when this entity is being deleted
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