Commit 54d055e5 authored by Łukasz Nowak's avatar Łukasz Nowak

- 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.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33506 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 48a25e2b
...@@ -267,7 +267,9 @@ class PreferenceTool(BaseTool): ...@@ -267,7 +267,9 @@ class PreferenceTool(BaseTool):
template_list = [] template_list = []
for portal_type in allowed_content_types: for portal_type in allowed_content_types:
for template_url in _getDocumentTemplateList(user_id, portal_type=portal_type): 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 return template_list
InitializeClass(PreferenceTool) InitializeClass(PreferenceTool)
......
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