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
d27ae6dd
Commit
d27ae6dd
authored
Apr 03, 2020
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
d27ae6dd
...
...
@@ -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
,
...
...
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