Fix filter when creating git_name and add git_name to projects 11/14511/3
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 15 Aug 2024 07:50:55 +0000 (09:50 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 16 Aug 2024 16:55:25 +0000 (18:55 +0200)
Change-Id: I65b66bc3f601854dfde6552ab4e5775f6f26b576
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_nbi/admin_topics.py
osm_nbi/auth.py
osm_nbi/base_topic.py

index f43ea18..02a9737 100644 (file)
@@ -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)
index 9c8c8d3..a30f60c 100644 (file)
@@ -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"])
index ce3400d..10ad1d6 100644 (file)
@@ -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(