Projet

Général

Profil

0001-admin-do-not-consider-drafts-on-remapping-status-492.patch

Thomas Noël, 08 décembre 2020 15:45

Télécharger (1,19 ko)

Voir les différences:

Subject: [PATCH] admin: do not consider drafts on remapping status (#49259)

 wcs/admin/forms.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
wcs/admin/forms.py
916 916
            status_mapping['wf-%s' % status.id] = 'wf-%s' % \
917 917
                    form.get_widget('mapping-%s' % status.id).parse()
918 918
        if any([x[0] != x[1] for x in status_mapping.items()]):
919
            # if there are status changes, update all formdatas
919
            # if there are status changes, update all formdatas (except drafts)
920 920
            status_mapping.update({'draft': 'draft'})
921
            for item in self.formdef.data_class().select():
921
            for item in self.formdef.data_class().select([NotEqual('status', 'draft')]):
922 922
                item.status = status_mapping.get(item.status)
923 923
                if item.evolution:
924 924
                    for evo in item.evolution:
925
-