admin: do not consider drafts on remapping status (#49259)

This commit is contained in:
Thomas NOËL 2020-12-08 15:44:17 +01:00
parent 8ba1421c08
commit 47f956dd37
1 changed files with 2 additions and 2 deletions

View File

@ -916,9 +916,9 @@ class FormDefPage(Directory):
status_mapping['wf-%s' % status.id] = 'wf-%s' % \
form.get_widget('mapping-%s' % status.id).parse()
if any([x[0] != x[1] for x in status_mapping.items()]):
# if there are status changes, update all formdatas
# if there are status changes, update all formdatas (except drafts)
status_mapping.update({'draft': 'draft'})
for item in self.formdef.data_class().select():
for item in self.formdef.data_class().select([NotEqual('status', 'draft')]):
item.status = status_mapping.get(item.status)
if item.evolution:
for evo in item.evolution: