Projet

Général

Profil

0001-misc-handle-invisible-statuses-using-real_status-406.patch

Benjamin Dauvergne, 18 mai 2021 19:51

Télécharger (1,68 ko)

Voir les différences:

Subject: [PATCH] misc: handle invisible statuses using real_status (#40643)

The formdata API returns the visible status in data.workflow.status,
if we want to index the current status we must use
data.workflow.real_status.
 wcs_olap/feeder.py  | 4 +++-
 wcs_olap/wcs_api.py | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
wcs_olap/feeder.py
828 828
            json_data = {}
829 829

  
830 830
            # ignore formdata without status
831
            if data.workflow.status:
831
            if data.workflow.real_status:
832
                status_id = data.workflow.real_status.id
833
            elif data.workflow.status:
832 834
                status_id = data.workflow.status.id
833 835
            elif data.evolution:
834 836
                for evolution in reversed(data.evolution):
wcs_olap/wcs_api.py
78 78

  
79 79
class FormDataWorkflow(BaseObject):
80 80
    status = None
81
    real_status = None
81 82
    fields = None
82 83

  
83 84
    def __init__(self, wcs_api, **kwargs):
84 85
        super(FormDataWorkflow, self).__init__(wcs_api, **kwargs)
85 86
        self.status = BaseObject(wcs_api, **self.status) if self.status else None
87
        self.real_status = BaseObject(wcs_api, **self.real_status) if self.real_status else None
86 88
        self.fields = self.fields or {}
87 89

  
88 90

  
89
-