Commit d27ae6dd authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

get namespace by slug, plus set default name

parent d56470d0
Pipeline #8943 passed with stage
in 7 minutes and 14 seconds
......@@ -237,7 +237,7 @@ class Project(Links, NamedModel, TimeStampedModel):
logger.error(f'wrong branch "{branch}" in {self.git_path()}')
continue
forge, namespace, name = branch.split('/', maxsplit=2)
namespace, _ = Namespace.objects.get_or_create(name=namespace, slug=slugify(namespace))
namespace, _ = Namespace.objects.get_or_create(slug=slugify(namespace), defaults={'name': namespace})
forge = Forge.objects.get(slug=forge)
repo, created = Repo.objects.get_or_create(forge=forge,
namespace=namespace,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment