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

[wf] ensure fromstates given, allow to give an entity (avoid spotless error,...

[wf] ensure fromstates given, allow to give an entity (avoid spotless error, we can iter on entities...)

--HG--
branch : 3.5
parent d8f2e53702be
......@@ -111,6 +111,9 @@ class Workflow(AnyEntity):
self.req.execute('SET T transition_of WF '
'WHERE T eid %(t)s, WF eid %(wf)s',
{'t': tr.eid, 'wf': self.eid}, ('t', 'wf'))
assert fromstates, fromstates
if not isinstance(fromstates, (tuple, list)):
fromstates = (fromstates,)
for state in fromstates:
if hasattr(state, 'eid'):
state = state.eid
......
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