diff --git a/tests/form_pages/test_all.py b/tests/form_pages/test_all.py index 225fa6010..2941ccc9c 100644 --- a/tests/form_pages/test_all.py +++ b/tests/form_pages/test_all.py @@ -6026,10 +6026,10 @@ def test_user_global_action_same_status_store(pub): assert 'button-action-1' in resp.form.fields resp = resp.form.submit('button-action-1') # click global action - # check status actions are not rerun + # check status actions are rerun resp = app.get(formdata.get_url()) assert formdef.data_class().get(formdata.id).status == 'wf-new' - assert formdef.data_class().get(formdata.id).data['bo1'] == '123' + assert formdef.data_class().get(formdata.id).data['bo1'] == '321' def test_anonymous_user_global_action(pub): diff --git a/wcs/formdata.py b/wcs/formdata.py index 617350693..2431a4c16 100644 --- a/wcs/formdata.py +++ b/wcs/formdata.py @@ -591,7 +591,7 @@ class FormData(StorableObject): for action in self.formdef.workflow.get_global_actions_for_user(formdata=self, user=user): if action.id != action_id: continue - return perform_items(action.items, self, event=(event_name, action.id)) + return perform_items(action.items, self, event=(event_name, action.id), global_action=True) def get_workflow_messages(self, position='top', user=None): wf_status = self.get_visible_status(user=user) diff --git a/wcs/workflows.py b/wcs/workflows.py index 40d747408..9e1cf2664 100644 --- a/wcs/workflows.py +++ b/wcs/workflows.py @@ -70,7 +70,7 @@ def lax_int(s): return -1 -def perform_items(items, formdata, depth=20, event=None): +def perform_items(items, formdata, depth=20, event=None, global_action=False): if depth == 0: # prevents infinite loops return url = None @@ -96,7 +96,7 @@ def perform_items(items, formdata, depth=20, event=None): if formdata.id: # don't save formdata it has been removed formdata.store() - if formdata.status != old_status: + if formdata.status != old_status or (global_action and 'jump' in [x[1] for x in performed_actions]): if not formdata.evolution: formdata.evolution = [] evo = Evolution()