formdata: catch various bugs happening with draft forms
This commit is contained in:
parent
0bb4f40c1c
commit
ebe3e94fde
|
@ -168,6 +168,8 @@ class FormData(StorableObject):
|
||||||
|
|
||||||
def display_workflow_message(self):
|
def display_workflow_message(self):
|
||||||
wf_status = self.get_workflow_status()
|
wf_status = self.get_workflow_status()
|
||||||
|
if not wf_status:
|
||||||
|
return ''
|
||||||
for status in wf_status.items:
|
for status in wf_status.items:
|
||||||
if hasattr(status, 'get_message'):
|
if hasattr(status, 'get_message'):
|
||||||
return status.get_message(self)
|
return status.get_message(self)
|
||||||
|
@ -209,6 +211,8 @@ class FormData(StorableObject):
|
||||||
|
|
||||||
def get_workflow_form(self, user):
|
def get_workflow_form(self, user):
|
||||||
wf_status = self.get_workflow_status()
|
wf_status = self.get_workflow_status()
|
||||||
|
if not wf_status:
|
||||||
|
return None
|
||||||
return wf_status.get_action_form(self, user)
|
return wf_status.get_action_form(self, user)
|
||||||
|
|
||||||
def get_workflow_subdirectories(self):
|
def get_workflow_subdirectories(self):
|
||||||
|
@ -289,8 +293,9 @@ class FormData(StorableObject):
|
||||||
|
|
||||||
if self.formdef.workflow and self.status:
|
if self.formdef.workflow and self.status:
|
||||||
wf_status = self.get_workflow_status()
|
wf_status = self.get_workflow_status()
|
||||||
for item in wf_status.items:
|
if wf_status:
|
||||||
d.update(item.get_substitution_variables(self))
|
for item in wf_status.items:
|
||||||
|
d.update(item.get_substitution_variables(self))
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue