From 46c27e1d592a2600f212b73fbad9416067d9919e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20NO=C3=8BL?= Date: Tue, 8 Dec 2020 15:44:17 +0100 Subject: [PATCH 1/2] admin: do not consider drafts on remapping status (#49259) --- wcs/admin/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcs/admin/forms.py b/wcs/admin/forms.py index 8ef84d0f..bc88ba0d 100644 --- a/wcs/admin/forms.py +++ b/wcs/admin/forms.py @@ -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: -- 2.29.2