formdata: catch various bugs happening with draft forms

This commit is contained in:
Frédéric Péters 2013-02-22 10:19:06 +01:00 committed by Thomas NOEL
parent 0bb4f40c1c
commit ebe3e94fde
1 changed files with 7 additions and 2 deletions

View File

@ -168,6 +168,8 @@ class FormData(StorableObject):
def display_workflow_message(self):
wf_status = self.get_workflow_status()
if not wf_status:
return ''
for status in wf_status.items:
if hasattr(status, 'get_message'):
return status.get_message(self)
@ -209,6 +211,8 @@ class FormData(StorableObject):
def get_workflow_form(self, user):
wf_status = self.get_workflow_status()
if not wf_status:
return None
return wf_status.get_action_form(self, user)
def get_workflow_subdirectories(self):
@ -289,8 +293,9 @@ class FormData(StorableObject):
if self.formdef.workflow and self.status:
wf_status = self.get_workflow_status()
for item in wf_status.items:
d.update(item.get_substitution_variables(self))
if wf_status:
for item in wf_status.items:
d.update(item.get_substitution_variables(self))
return d