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
aeea7210
Commit
aeea7210
authored
Nov 23, 2018
by
Guilhem Saurel
Browse files
look for lower() slugs
parent
e8324736
Pipeline
#1917
passed with stages
in 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
aeea7210
...
...
@@ -12,8 +12,9 @@ from django.template.loader import get_template
from
django.utils.dateparse
import
parse_datetime
from
django.utils.safestring
import
mark_safe
import
git
import
requests
import
git
from
autoslug
import
AutoSlugField
from
ndh.models
import
Links
,
NamedModel
,
TimeStampedModel
from
ndh.utils
import
enum_to_choices
,
query_sum
...
...
@@ -115,7 +116,8 @@ class Forge(Links, NamedModel):
def
get_namespaces_github
(
self
):
for
namespace
in
Namespace
.
objects
.
filter
(
group
=
True
):
for
data
in
self
.
api_list
(
f
'/orgs/
{
namespace
.
slug
}
/members'
):
Namespace
.
objects
.
get_or_create
(
slug
=
data
[
'login'
],
defaults
=
{
'name'
:
data
[
'login'
],
'group'
:
False
})
Namespace
.
objects
.
get_or_create
(
slug
=
data
[
'login'
].
lower
(),
defaults
=
{
'name'
:
data
[
'login'
],
'group'
:
False
})
def
get_namespaces_gitlab
(
self
):
for
data
in
self
.
api_list
(
'/namespaces'
):
...
...
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