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

cleanup

--HG--
branch : 3.5
parent f221ba8552ab
......@@ -168,6 +168,11 @@ class BaseTransition(AnyEntity):
def workflow(self):
return self.transition_of[0]
def has_input_state(self, state):
if hasattr(state, 'eid'):
state = state.eid
return any(s for s in self.reverse_allowed_transition if s.eid == state)
def may_be_fired(self, eid):
"""return true if the logged user may fire this transition
......@@ -233,11 +238,6 @@ class Transition(BaseTransition):
def destination(self):
return self.destination_state[0]
def has_input_state(self, state):
if hasattr(state, 'eid'):
state = state.eid
return any(s for s in self.reverse_allowed_transition if s.eid == state)
class WorkflowTransition(BaseTransition):
"""customized class for WorkflowTransition entities"""
......@@ -362,7 +362,7 @@ class WorkflowableMixIn(object):
@property
def current_workflow(self):
"""return current workflow applied to this entity"""
return self.current_state.workflow
return self.current_state and self.current_state.workflow or self.main_workflow
@property
def current_state(self):
......
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