Skip to content
GitLab
Menu
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
3bf7d57b
Commit
3bf7d57b
authored
Jun 07, 2021
by
Guilhem Saurel
Browse files
…
parent
ecfcbbae
Pipeline
#14837
failed with stage
in 2 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
3bf7d57b
...
...
@@ -6,7 +6,7 @@ from subprocess import check_output
from
django.conf
import
settings
from
django.db
import
models
from
django.db.models
import
Q
from
django.db.utils
import
DataError
from
django.db.utils
import
DataError
,
IntegrityError
from
django.template.loader
import
get_template
from
django.utils
import
timezone
from
django.utils.dateparse
import
parse_datetime
...
...
@@ -150,11 +150,18 @@ class Forge(Links, NamedModel):
for
data
in
self
.
api_list
(
'/namespaces'
):
if
data
[
'name'
]
==
'dockering'
:
continue
Namespace
.
objects
.
get_or_create
(
slug
=
slugify
(
data
[
'path'
]),
defaults
=
{
'name'
:
data
[
'name'
],
'group'
:
data
[
'kind'
]
==
'group'
})
try
:
Namespace
.
objects
.
get_or_create
(
slug
=
slugify
(
data
[
'path'
]),
defaults
=
{
'name'
:
data
[
'name'
],
'group'
:
data
[
'kind'
]
==
'group'
})
except
IntegrityError
:
Namespace
.
objects
.
get_or_create
(
slug
=
slugify
(
data
[
'path'
]),
defaults
=
{
'name'
:
data
[
'name'
]
+
' 2'
,
'group'
:
data
[
'kind'
]
==
'group'
})
for
data
in
self
.
api_list
(
'/users'
):
Namespace
.
objects
.
get_or_create
(
slug
=
slugify
(
data
[
'username'
]),
defaults
=
{
'name'
:
data
[
'name'
]})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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