[Erp5-report] r33506 luke - /erp5/trunk/products/ERP5Form/PreferenceTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Mar 8 17:25:25 CET 2010


Author: luke
Date: Mon Mar  8 17:25:24 2010
New Revision: 33506

URL: http://svn.erp5.org?rev=33506&view=rev
Log:
 - do not fail in case if template is not found

As list of templates is cached, and cache might be not invalidated after
deletion of template, do not fail in case if template is not found in ZODB.

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=33506&r1=33505&r2=33506&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/PreferenceTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/PreferenceTool.py [utf8] Mon Mar  8 17:25:24 2010
@@ -267,7 +267,9 @@
     template_list = []
     for portal_type in allowed_content_types:
       for template_url in _getDocumentTemplateList(user_id, portal_type=portal_type):
-        template_list.append(self.restrictedTraverse(template_url))
+        template = self.restrictedTraverse(template_url, None)
+        if template is not None:
+          template_list.append(template)
     return template_list
 
 InitializeClass(PreferenceTool)




More information about the Erp5-report mailing list