From: garciadeblas Date: Thu, 15 Aug 2024 07:50:55 +0000 (+0200) Subject: Fix filter when creating git_name and add git_name to projects X-Git-Tag: release-v16.0-start~4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=b602547e63ea25b532f6fd10f21eda5a85bcc039;p=osm%2FNBI.git Fix filter when creating git_name and add git_name to projects Change-Id: I65b66bc3f601854dfde6552ab4e5775f6f26b576 Signed-off-by: garciadeblas --- diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index f43ea18..02a9737 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -1351,6 +1351,7 @@ class ProjectTopicAuth(ProjectTopic): self.format_on_new( content, project_id=session["project_id"], make_public=session["public"] ) + self.create_gitname(content, session) _id = self.auth.create_project(content) rollback.append({"topic": self.topic, "_id": _id}) self._send_msg("created", content, not_send_msg=None) diff --git a/osm_nbi/auth.py b/osm_nbi/auth.py index 9c8c8d3..a30f60c 100644 --- a/osm_nbi/auth.py +++ b/osm_nbi/auth.py @@ -232,6 +232,7 @@ class Authenticator: now = time() project_desc["_id"] = str(uuid4()) project_desc["_admin"] = {"created": now, "modified": now} + project_desc["git_name"] = "osm_admin" pid = self.backend.create_project(project_desc) self.logger.info( "Project '{}' created at database".format(project_desc["name"]) diff --git a/osm_nbi/base_topic.py b/osm_nbi/base_topic.py index ce3400d..10ad1d6 100644 --- a/osm_nbi/base_topic.py +++ b/osm_nbi/base_topic.py @@ -651,7 +651,7 @@ class BaseTopic: _filter = {} else: _filter = self._get_project_filter(session) - _filter["name"] = content["name"] + _filter["git_name"] = content["name"] if _id: _filter["_id.neq"] = _id if self.db.get_one(