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.
This commit is contained in:
parent
f7f1a6d26f
commit
d44fafb844
|
@ -828,7 +828,9 @@ class WcsFormdefFeeder(object):
|
|||
json_data = {}
|
||||
|
||||
# ignore formdata without status
|
||||
if data.workflow.status:
|
||||
if data.workflow.real_status:
|
||||
status_id = data.workflow.real_status.id
|
||||
elif data.workflow.status:
|
||||
status_id = data.workflow.status.id
|
||||
elif data.evolution:
|
||||
for evolution in reversed(data.evolution):
|
||||
|
|
|
@ -78,11 +78,13 @@ class BaseObject(object):
|
|||
|
||||
class FormDataWorkflow(BaseObject):
|
||||
status = None
|
||||
real_status = None
|
||||
fields = None
|
||||
|
||||
def __init__(self, wcs_api, **kwargs):
|
||||
super(FormDataWorkflow, self).__init__(wcs_api, **kwargs)
|
||||
self.status = BaseObject(wcs_api, **self.status) if self.status else None
|
||||
self.real_status = BaseObject(wcs_api, **self.real_status) if self.real_status else None
|
||||
self.fields = self.fields or {}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue