From: Eduardo Sousa Date: Thu, 30 May 2019 12:18:36 +0000 (+0100) Subject: Maintain format of project_role_mappings for creating and listing X-Git-Tag: v6.0.0~28 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=88d58a433404dd19d30a1cce169577a1bd175d90;p=osm%2FNBI.git Maintain format of project_role_mappings for creating and listing Change-Id: Ia6e8589357b491cefe88101ff74844789059a016 Signed-off-by: Eduardo Sousa --- 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"]