From f826f1a8bcd62b9572ba07486d18004ff48b0818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 9 Nov 2015 09:52:06 +0100 Subject: [PATCH] api: fix list of roles in formdata API (#8922) --- tests/test_api.py | 2 ++ wcs/formdata.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_api.py b/tests/test_api.py index c98c988..76b0800 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -411,8 +411,10 @@ def test_formdata(pub, local_user): Role.wipe() role = Role(name='test') + role.id = '123' role.store() another_role = Role(name='another') + another_role.id = '321' another_role.store() FormDef.wipe() formdef = FormDef() diff --git a/wcs/formdata.py b/wcs/formdata.py index d938b16..9ce8e95 100644 --- a/wcs/formdata.py +++ b/wcs/formdata.py @@ -635,7 +635,7 @@ class FormData(StorableObject): if self.workflow_roles: workflow_roles.update(self.workflow_roles) for workflow_role in workflow_roles: - data['roles'][workflow_role] = workflow_roles.get(workflow_role) + data['roles'][workflow_role] = [workflow_roles.get(workflow_role)] data['roles']['concerned'] = self.get_concerned_roles() data['roles']['actions'] = self.get_actions_roles() -- 2.6.2