Commit 80fc73fd authored by Jean-Paul Smets's avatar Jean-Paul Smets

Use accessors and do not hide errors

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27119 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 242101f0
...@@ -50,8 +50,7 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper): ...@@ -50,8 +50,7 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper):
""" """
Returns the title of the documentation helper Returns the title of the documentation helper
""" """
return DocumentationHelper.getTitle(self) \ return DocumentationHelper.getTitle(self) or getattr(self.getDocumentedObject(), 'actbox_name')
or self.getDocumentedObject().actbox_name
security.declareProtected(Permissions.AccessContentsInformation, 'getNewState') security.declareProtected(Permissions.AccessContentsInformation, 'getNewState')
def getNewState(self): def getNewState(self):
...@@ -61,6 +60,7 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper): ...@@ -61,6 +60,7 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper):
if new_state_id: if new_state_id:
uri = '%s/states/%s' % (self.uri.rsplit('/',2)[0], new_state_id) uri = '%s/states/%s' % (self.uri.rsplit('/',2)[0], new_state_id)
return self.getDocumentationHelper('DCWorkflowStateDocumentationHelper', uri) return self.getDocumentationHelper('DCWorkflowStateDocumentationHelper', uri)
security.declareProtected(Permissions.AccessContentsInformation, 'getTriggerType') security.declareProtected(Permissions.AccessContentsInformation, 'getTriggerType')
def getTriggerType(self): def getTriggerType(self):
...@@ -68,7 +68,7 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper): ...@@ -68,7 +68,7 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper):
Returns the trigger type for de workflow transition Returns the trigger type for de workflow transition
""" """
trigger_type_list = ['Automatic','Initiated by user action','Initiated by WorkflowMethod'] trigger_type_list = ['Automatic','Initiated by user action','Initiated by WorkflowMethod']
trigger_type_id = getattr(self.getDocumentedObject(), "trigger_type", '') trigger_type_id = getattr(self.getDocumentedObject(), "trigger_type")
return trigger_type_list[trigger_type_id] return trigger_type_list[trigger_type_id]
security.declareProtected(Permissions.AccessContentsInformation, 'getScriptName') security.declareProtected(Permissions.AccessContentsInformation, 'getScriptName')
...@@ -76,14 +76,14 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper): ...@@ -76,14 +76,14 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper):
""" """
Returns the name of the script for de workflow transition Returns the name of the script for de workflow transition
""" """
return getattr(self.getDocumentedObject(), "script_name", '') return getattr(self.getDocumentedObject(), "script_name")
security.declareProtected(Permissions.AccessContentsInformation, 'getAfterScriptName') security.declareProtected(Permissions.AccessContentsInformation, 'getAfterScriptName')
def getAfterScriptName(self): def getAfterScriptName(self):
""" """
Returns the name of the script for de workflow transition Returns the name of the script for de workflow transition
""" """
return getattr(self.getDocumentedObject(), "after_script_name", '') return getattr(self.getDocumentedObject(), "after_script_name")
security.declareProtected(Permissions.AccessContentsInformation, 'getRoleColumnList') security.declareProtected(Permissions.AccessContentsInformation, 'getRoleColumnList')
def getRoleColumnList(self): def getRoleColumnList(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