X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fadmin_topics.py;h=85fe9ff20141666c79ede243ff6b93f6e247e06b;hp=ceb8e89dd7d941774bf204d394b9be686665ce60;hb=refs%2Fchanges%2F35%2F7735%2F1;hpb=ceb8baf31217c9d50ce7017beb25c59163d79b6e diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index ceb8e89..85fe9ff 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -402,8 +402,13 @@ class UserTopicAuth(UserTopic): raise EngineException("username '{}' is already used".format(username), HTTPStatus.CONFLICT) if "projects" in indata.keys(): - raise EngineException("Format invalid: the keyword \"projects\" is not allowed for keystone authentication", - HTTPStatus.BAD_REQUEST) + # convert to new format project_role_mappings + if not indata.get("project_role_mappings"): + indata["project_role_mappings"] = [] + for project in indata["projects"]: + indata["project_role_mappings"].append({"project": project, "role": "project_user"}) + # raise EngineException("Format invalid: the keyword 'projects' is not allowed for keystone authentication", + # HTTPStatus.BAD_REQUEST) def check_conflict_on_edit(self, session, final_content, edit_content, _id): """