Commit f0a1df44 authored by Sebastien Robin's avatar Sebastien Robin

it makes no sense to calculate portal_url outside the cached method and use it...

it makes no sense to calculate portal_url outside the cached method and use it inside the cached method, by moving this calculation the performance might comes back to a better result

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15282 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b84a65dd
...@@ -115,8 +115,6 @@ def DCWorkflowDefinition_listGlobalActions(self, info): ...@@ -115,8 +115,6 @@ def DCWorkflowDefinition_listGlobalActions(self, info):
return None # Optimization return None # Optimization
workflow_tool = getToolByName(self, 'portal_workflow') workflow_tool = getToolByName(self, 'portal_workflow')
workflow = getattr(workflow_tool, self.id) workflow = getattr(workflow_tool, self.id)
portal_url = getToolByName(self, 'portal_url')
portal_url = portal_url()
_getPortalTypeListForWorkflow = CachingMethod(workflow.getPortalTypeListForWorkflow, _getPortalTypeListForWorkflow = CachingMethod(workflow.getPortalTypeListForWorkflow,
id=('_getPortalTypeListForWorkflow', self.id), id=('_getPortalTypeListForWorkflow', self.id),
cache_factory = 'erp5_ui_long') cache_factory = 'erp5_ui_long')
...@@ -125,6 +123,8 @@ def DCWorkflowDefinition_listGlobalActions(self, info): ...@@ -125,6 +123,8 @@ def DCWorkflowDefinition_listGlobalActions(self, info):
return None return None
def _listGlobalActions(user=None, id=None, portal_path=None): def _listGlobalActions(user=None, id=None, portal_path=None):
portal_url = getToolByName(self, 'portal_url')
portal_url = portal_url()
sm = getSecurityManager() sm = getSecurityManager()
portal = self._getPortalRoot() portal = self._getPortalRoot()
res = [] res = []
......
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