Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Henrik Skov Midtiby
gitlab-assignment-handler
Commits
313de912
Commit
313de912
authored
Mar 11, 2020
by
Henrik Skov Midtiby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only enter a class if the name matches exactly.
parent
7d53eb15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
gitlab_class_helper/gitlab_class_helper.py
gitlab_class_helper/gitlab_class_helper.py
+10
-9
No files found.
gitlab_class_helper/gitlab_class_helper.py
View file @
313de912
...
...
@@ -170,15 +170,16 @@ class GitlabClassHelper:
url
=
self
.
path
+
'/groups/%d/subgroups?search=%s'
%
(
id_of_parent_group
,
group_name
)
resp
=
requests
.
get
(
url
,
headers
=
self
.
headers
)
if
resp
.
ok
:
if
len
(
resp
.
json
())
==
1
:
idx
=
resp
.
json
()[
0
][
'id'
]
self
.
group_id
=
idx
web_url
=
resp
.
json
()[
0
][
'web_url'
]
print
(
'Entering the "%s" group in gitlab.'
%
group_name
)
print
(
'web_url to the group: %s'
%
web_url
)
print
(
'Id of the group: %d'
%
idx
)
print
(
'Working in this group now.'
)
return
idx
for
group_candidate
in
resp
.
json
():
if
(
group_name
==
group_candidate
[
'name'
]):
idx
=
group_candidate
[
'id'
]
self
.
group_id
=
idx
web_url
=
group_candidate
[
'web_url'
]
print
(
'Entering the "%s" group in gitlab.'
%
group_name
)
print
(
'web_url to the group: %s'
%
web_url
)
print
(
'Id of the group: %d'
%
idx
)
print
(
'Working in this group now.'
)
return
idx
else
:
raise
NameError
(
'%d groups found in group: %d when searching on %s'
%
(
len
(
resp
.
json
()),
id_of_parent_group
,
group_name
))
else
:
...
...
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