From 72c608dd4d7b99d41aaa698826a053bff9658b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 16 Nov 2016 13:26:28 +0100 Subject: [PATCH] workflows: add an id to the action form (#13990) --- tests/test_backoffice_pages.py | 4 ++-- wcs/workflows.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_backoffice_pages.py b/tests/test_backoffice_pages.py index b7078fe..cbfec1a 100644 --- a/tests/test_backoffice_pages.py +++ b/tests/test_backoffice_pages.py @@ -2636,7 +2636,7 @@ def test_backoffice_advisory_lock(pub): resp = app.get('/backoffice/management/form-title/' + first_link) assert not 'Be warned forms of this user are also being looked' in resp.body assert 'button_commentable' in resp.body - assert len(resp.forms) == 1 + assert len(resp.forms) resp = app2.get('/backoffice/management/form-title/' + first_link) assert 'Be warned forms of this user are also being looked' in resp.body assert not 'button_commentable' in resp.body @@ -2654,7 +2654,7 @@ def test_backoffice_advisory_lock(pub): assert 'Be warned forms of this user are also being looked' in resp.body assert 'button_commentable' in resp.body assert not '(unlock actions)' in resp.body - assert len(resp.forms) == 1 + assert len(resp.forms) # submit action form resp.form['comment'] = 'HELLO' diff --git a/wcs/workflows.py b/wcs/workflows.py index ff015b8..2fad2ba 100644 --- a/wcs/workflows.py +++ b/wcs/workflows.py @@ -1300,7 +1300,8 @@ class WorkflowStatus(object): raise KeyError() def get_action_form(self, filled, user): - form = Form(enctype='multipart/form-data', use_tokens = False) + form = Form(enctype='multipart/form-data', use_tokens=False) + form.attrs['id'] = 'wf-actions' for item in self.items: if not item.check_auth(filled, user): continue -- 2.10.2