From 88d58a433404dd19d30a1cce169577a1bd175d90 Mon Sep 17 00:00:00 2001 From: Eduardo Sousa Date: Thu, 30 May 2019 13:18:36 +0100 Subject: [PATCH] Maintain format of project_role_mappings for creating and listing Change-Id: Ia6e8589357b491cefe88101ff74844789059a016 Signed-off-by: Eduardo Sousa --- osm_nbi/admin_topics.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index eb8c988..bc2c7d9 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -478,7 +478,7 @@ class UserTopicAuth(UserTopic): for project in content["projects"]: for role in project["roles"]: - project_role_mappings.append([project, role]) + project_role_mappings.append({"project": project, "role": role}) del content["projects"] content["project_role_mappings"] = project_role_mappings @@ -569,15 +569,15 @@ class UserTopicAuth(UserTopic): for mapping in mappings_to_remove: self.auth.remove_role_from_user( user["name"], - mapping[0], - mapping[1] + mapping["project"], + mapping["role"] ) for mapping in mappings_to_add: self.auth.assign_role_to_user( user["name"], - mapping[0], - mapping[1] + mapping["project"], + mapping["role"] ) return content["_id"] -- 2.25.1