Commit 11827c3f authored by iv's avatar iv

ERP5Workflow: add variable to avoid multiple call to function and remove...

ERP5Workflow: add variable to avoid multiple call to function and remove successive 'if/continue' for readability
parent 5e956eaa
...@@ -32,21 +32,17 @@ for portal_type in portal_type: ...@@ -32,21 +32,17 @@ for portal_type in portal_type:
workflow_set.add(workflow_id) workflow_set.add(workflow_id)
workflow = workflow_tool[workflow_id] workflow = workflow_tool[workflow_id]
state_value_dict = workflow.getStateValueDict()
# skip interaction workflows or workflows with only one state (such as edit_workflow) # skip interaction workflows
if workflow.getStateValueDict() is None or len(workflow.getStateIdList()) <= 1: # or workflows with only one state (such as edit_workflow)
continue # or workflows using another state variable
if (state_value_dict is not None
# skip workflows using another state variable and len(workflow.getStateIdList()) > 1
if state_var not in (None, workflow.getStateVariable()): and state_var in (None, workflow.getStateVariable()):
continue for state in state_value_dict.values():
if not state_id in state_set:
for state_id in workflow.getStateValueDict(): state_set.add(state_id)
state = workflow.getStateValueDict().get(state_id) result_list.append((str(translateString(state.title)), state_id))
if state_id in state_set:
continue
state_set.add(state_id)
result_list.append((str(translateString(state.title)), state_id))
return result_list return result_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