Commit ad17f2a3 authored by Mayoro Diagne's avatar Mayoro Diagne

- taking the case wich there is no business_template_list in REQUEST

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23519 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 78479cbb
...@@ -86,7 +86,7 @@ class ERP5SiteDocumentationHelper(DocumentationHelper): ...@@ -86,7 +86,7 @@ class ERP5SiteDocumentationHelper(DocumentationHelper):
""" """
REQUEST = getattr(self, 'REQUEST', None) REQUEST = getattr(self, 'REQUEST', None)
business_template_list = [bt.getTitle() for bt in self.getDocumentedObject().portal_templates.objectValues()] business_template_list = [bt.getTitle() for bt in self.getDocumentedObject().portal_templates.objectValues()]
if REQUEST is not None: if REQUEST is not None and "business_template_list" in REQUEST.keys():
business_template_list = REQUEST.get("business_template_list", []) business_template_list = REQUEST.get("business_template_list", [])
return [(bt.getId(), return [(bt.getId(),
getattr(bt, "title", ''), getattr(bt, "title", ''),
...@@ -95,7 +95,7 @@ class ERP5SiteDocumentationHelper(DocumentationHelper): ...@@ -95,7 +95,7 @@ class ERP5SiteDocumentationHelper(DocumentationHelper):
getattr(bt, "revision", '')) getattr(bt, "revision", ''))
for bt in self.getDocumentedObject().portal_templates.objectValues() for bt in self.getDocumentedObject().portal_templates.objectValues()
if bt.getInstallationState() == 'installed' and bt.getTitle() in business_template_list] if bt.getInstallationState() == 'installed' and bt.getTitle() in business_template_list]
security.declareProtected( Permissions.AccessContentsInformation, 'getBusinessTemplateURIList' ) security.declareProtected( Permissions.AccessContentsInformation, 'getBusinessTemplateURIList' )
def getBusinessTemplateURIList(self): def getBusinessTemplateURIList(self):
""" """
......
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