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,10 +66,10 @@ class CatalogMethodDocumentationHelper(DocumentationHelper): ...@@ -66,10 +66,10 @@ class CatalogMethodDocumentationHelper(DocumentationHelper):
security.declareProtected(Permissions.AccessContentsInformation, 'getSource' ) security.declareProtected(Permissions.AccessContentsInformation, 'getSource' )
def getSource(self): def getSource(self):
""" """
Returns the source code of the documentation helper Returns the source code the catalog method
""" """
from zLOG import LOG, INFO from zLOG import LOG, INFO
source_code = getattr(self.getDocumentedObject(), 'src', '') source_code = getattr(self.getDocumentedObject(), 'src', '')
portal_transforms = getattr(self, 'portal_transforms', None) portal_transforms = getattr(self, 'portal_transforms', None)
if portal_transforms is not None: if portal_transforms is not None:
REQUEST = getattr(self, 'REQUEST', None) REQUEST = getattr(self, 'REQUEST', None)
......
...@@ -44,7 +44,11 @@ class PortalTypeRoleDocumentationHelper(DocumentationHelper): ...@@ -44,7 +44,11 @@ class PortalTypeRoleDocumentationHelper(DocumentationHelper):
security.declareProtected(Permissions.AccessContentsInformation, 'getDescription') security.declareProtected(Permissions.AccessContentsInformation, 'getDescription')
def getDescription(self): 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' ) security.declareProtected(Permissions.AccessContentsInformation, 'getType' )
def getType(self): 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