also migrate formdata evolution to new workflows

This commit is contained in:
Thomas NOËL 2012-11-05 15:15:33 +01:00
parent de48f2420f
commit f13883763f
2 changed files with 6 additions and 1 deletions

View File

@ -115,6 +115,11 @@ class FormData(StorableObject):
if self.status and not self.status.startswith('wf-'):
self.status = 'wf-%s' % self.status
changed = True
if self.evolution:
for evo in self.evolution:
if evo.status and not evo.status.startswith('wf-'):
evo.status = 'wf-%s' % evo.status
changed = True
if changed:
self.store()

View File

@ -154,7 +154,7 @@ class FormStatusPage(Directory):
for evo in self.filled.evolution:
if evo.status:
wf_status = self.filled.get_status(evo.status)
if not wf_status.is_visible(self.filled, get_request().user):
if wf_status and not wf_status.is_visible(self.filled, get_request().user):
hidden = True
else:
hidden = False