Commit 7587412a authored by Jérome Perrin's avatar Jérome Perrin

use the same cache factory for preference template than for preference

management, otherwise when user activates another preference, the old template
will be shown


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43842 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a682709e
...@@ -220,15 +220,14 @@ class PreferenceTool(BaseTool): ...@@ -220,15 +220,14 @@ class PreferenceTool(BaseTool):
# We must set the user_id as a parameter to make sure each # We must set the user_id as a parameter to make sure each
# user can get a different cache # user can get a different cache
def _getDocumentTemplateList(user_id, portal_type=None): def _getDocumentTemplateList(user_id, portal_type=None):
acceptable_templates = [] acceptable_template_list = []
for pref in self._getSortedPreferenceList() : for pref in self._getSortedPreferenceList() :
for doc in pref.contentValues() : for doc in pref.contentValues(portal_type=portal_type) :
if doc.getPortalType() == portal_type: acceptable_template_list.append(doc.getRelativeUrl())
acceptable_templates.append(doc.getRelativeUrl()) return acceptable_template_list
return acceptable_templates
_getDocumentTemplateList = CachingMethod(_getDocumentTemplateList, _getDocumentTemplateList = CachingMethod(_getDocumentTemplateList,
'portal_preferences.getDocumentTemplateList', 'portal_preferences.getDocumentTemplateList',
cache_factory='erp5_ui_medium') cache_factory='erp5_ui_short')
allowed_content_types = map(lambda pti: pti.id, allowed_content_types = map(lambda pti: pti.id,
folder.allowedContentTypes()) folder.allowedContentTypes())
......
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