Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
d56470d0
Commit
d56470d0
authored
Apr 01, 2020
by
Guilhem Saurel
Browse files
fix namespace get_or_create
parent
090af0fa
Pipeline
#8907
passed with stage
in 1 minute and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
d56470d0
...
...
@@ -3,6 +3,8 @@ import logging
import
re
from
subprocess
import
check_output
import
git
import
requests
from
django.conf
import
settings
from
django.db
import
models
from
django.db.models
import
Q
...
...
@@ -13,9 +15,6 @@ from django.utils import timezone
from
django.utils.dateparse
import
parse_datetime
from
django.utils.safestring
import
mark_safe
import
requests
import
git
from
autoslug
import
AutoSlugField
from
autoslug.utils
import
slugify
from
ndh.models
import
Links
,
NamedModel
,
TimeStampedModel
...
...
@@ -238,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
(
slug
=
namespace
)
namespace
,
_
=
Namespace
.
objects
.
get_or_create
(
name
=
namespace
,
slug
=
slugify
(
namespace
)
)
forge
=
Forge
.
objects
.
get
(
slug
=
forge
)
repo
,
created
=
Repo
.
objects
.
get_or_create
(
forge
=
forge
,
namespace
=
namespace
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment