Commit e127b669 authored by Nicolas Dumazet's avatar Nicolas Dumazet

and we dont need to access Localizer if enable_sort=False


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42437 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2277f1bb
......@@ -520,9 +520,12 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
type_list.sort(key=lambda x:translate('ui', x))
return tuple(type_list)
localizer_tool = getToolByName(self, 'Localizer')
language = localizer_tool.get_selected_language()
# language should be cached in Transaction Cache if performance issue
if enable_sort:
# language should be cached in Transaction Cache if performance issue
localizer_tool = getToolByName(self, 'Localizer')
language = localizer_tool.get_selected_language()
else:
localizer_tool = language = None
getTypeList = CachingMethod(getTypeList,
id=(('_getPortalGroupedTypeList', language), group,
......
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