Commit 0afaa9ff authored by Vincent Pelletier's avatar Vincent Pelletier

Make refreshWorklistCache safe to call even if the required scripts are not...

Make refreshWorklistCache safe to call even if the required scripts are not present. Also, it saves some acquisition lookups in the process.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18520 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8faa51ac
...@@ -546,6 +546,8 @@ def WorkflowTool_listActions(self, info=None, object=None): ...@@ -546,6 +546,8 @@ def WorkflowTool_listActions(self, info=None, object=None):
WorkflowTool.listActions = WorkflowTool_listActions WorkflowTool.listActions = WorkflowTool_listActions
def WorkflowTool_refreshWorklistCache(self): def WorkflowTool_refreshWorklistCache(self):
Base_zInsertIntoWorklistTable = getattr(self, 'Base_zInsertIntoWorklistTable', None)
if Base_zInsertIntoWorklistTable is not None:
# XXX: Code below is duplicated from WorkflowTool_listActions # XXX: Code below is duplicated from WorkflowTool_listActions
info = self._getOAI(None) info = self._getOAI(None)
worklist_dict = {} worklist_dict = {}
...@@ -599,6 +601,6 @@ def WorkflowTool_refreshWorklistCache(self): ...@@ -599,6 +601,6 @@ def WorkflowTool_refreshWorklistCache(self):
if column_id in value_column_dict: if column_id in value_column_dict:
value_column_dict[column_id].append(value) value_column_dict[column_id].append(value)
if len(value_column_dict[COUNT_COLUMN_TITLE]): if len(value_column_dict[COUNT_COLUMN_TITLE]):
self.Base_zInsertIntoWorklistTable(**value_column_dict) Base_zInsertIntoWorklistTable(**value_column_dict)
WorkflowTool.refreshWorklistCache = WorkflowTool_refreshWorklistCache WorkflowTool.refreshWorklistCache = WorkflowTool_refreshWorklistCache
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