Commit 0531a19b authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_hal_json_style: Tolerate worklist and workflow deletion.

listActions result is cached, and may refer to non-existing workflows
and/or worklists. Tolerate either of these being missing.
parent 59212692
...@@ -89,16 +89,18 @@ def WorkflowTool_listActionParameterList(self): ...@@ -89,16 +89,18 @@ def WorkflowTool_listActionParameterList(self):
for action in action_list: for action in action_list:
if (action['workflow_id'] not in workflow_dict): if (action['workflow_id'] not in workflow_dict):
workflow = self.getWorkflowById(action['workflow_id']) workflow = self.getWorkflowById(action['workflow_id'])
workflow_dict[action['workflow_id']] = workflow.getWorklistVariableMatchDict(info, check_guard=False) if workflow is not None:
workflow_dict[action['workflow_id']] = workflow.getWorklistVariableMatchDict(info, check_guard=False)
query = workflow_dict[action['workflow_id']][action['worklist_id']]
query.pop('metadata') query = workflow_dict[action['workflow_id']].get(action['worklist_id'])
result_list.append({ if query is not None:
'count': action['count'], query.pop('metadata')
'name': action['name'], result_list.append({
'local_roles': query.pop('local_roles'), 'count': action['count'],
'query': query 'name': action['name'],
}) 'local_roles': query.pop('local_roles'),
'query': query
})
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