X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fadmin_topics.py;h=76d4de816cf824058b887e0a692c85497849cf98;hp=71fb83b5dde738d3bd1a2284d215d280643458ee;hb=a519a962c9bf008ddbee26500557b1de287f323a;hpb=c5a18892d3b9e5a515c3adab0bafcdc097d9fe28 diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index 71fb83b..76d4de8 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -508,8 +508,9 @@ class UserTopicAuth(UserTopic): self.format_on_new(content, session["project_id"], make_public=session["public"]) _id = self.auth.create_user(content["username"], content["password"])["_id"] - for mapping in content["project_role_mappings"]: - self.auth.assign_role_to_user(_id, mapping["project"], mapping["role"]) + if "project_role_mappings" in content.keys(): + for mapping in content["project_role_mappings"]: + self.auth.assign_role_to_user(_id, mapping["project"], mapping["role"]) rollback.append({"topic": self.topic, "_id": _id}) del content["password"]