[Erp5-report] r43842 jerome - /erp5/trunk/products/ERP5Form/PreferenceTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 1 10:50:23 CET 2011


Author: jerome
Date: Tue Mar  1 10:50:23 2011
New Revision: 43842

URL: http://svn.erp5.org?rev=43842&view=rev
Log:
use the same cache factory for preference template than for preference
management, otherwise when user activates another preference, the old template
will be shown

Modified:
    erp5/trunk/products/ERP5Form/PreferenceTool.py

Modified: erp5/trunk/products/ERP5Form/PreferenceTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/PreferenceTool.py?rev=43842&r1=43841&r2=43842&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/PreferenceTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/PreferenceTool.py [utf8] Tue Mar  1 10:50:23 2011
@@ -220,15 +220,14 @@ class PreferenceTool(BaseTool):
     # We must set the user_id as a parameter to make sure each
     # user can get a different cache
     def _getDocumentTemplateList(user_id, portal_type=None):
-      acceptable_templates = []
+      acceptable_template_list = []
       for pref in self._getSortedPreferenceList() :
-        for doc in pref.contentValues() :
-          if doc.getPortalType() == portal_type:
-            acceptable_templates.append(doc.getRelativeUrl())
-      return acceptable_templates
+        for doc in pref.contentValues(portal_type=portal_type) :
+          acceptable_template_list.append(doc.getRelativeUrl())
+      return acceptable_template_list
     _getDocumentTemplateList = CachingMethod(_getDocumentTemplateList,
                           'portal_preferences.getDocumentTemplateList',
-                                             cache_factory='erp5_ui_medium')
+                                             cache_factory='erp5_ui_short')
 
     allowed_content_types = map(lambda pti: pti.id,
                                 folder.allowedContentTypes())



More information about the Erp5-report mailing list