Commit 0445bd52 authored by Mayoro Diagne's avatar Mayoro Diagne

testing documented object before calling Description()

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23424 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 12431c1e
......@@ -66,7 +66,7 @@ class CatalogMethodDocumentationHelper(DocumentationHelper):
security.declareProtected(Permissions.AccessContentsInformation, 'getSource' )
def getSource(self):
"""
Returns the source code of the documentation helper
Returns the source code the catalog method
"""
from zLOG import LOG, INFO
source_code = getattr(self.getDocumentedObject(), 'src', '')
......
......@@ -44,7 +44,11 @@ class PortalTypeRoleDocumentationHelper(DocumentationHelper):
security.declareProtected(Permissions.AccessContentsInformation, 'getDescription')
def getDescription(self):
return self.getDocumentedObject().Description()
documented_object = self.getDocumentedObject()
if documented_object is not None:
return documented_object.Description()
else:
return ''
security.declareProtected(Permissions.AccessContentsInformation, 'getType' )
def getType(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