Commit 313de912 authored by Henrik Skov Midtiby's avatar Henrik Skov Midtiby
Browse files

Only enter a class if the name matches exactly.

parent 7d53eb15
......@@ -170,10 +170,11 @@ 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']
for group_candidate in resp.json():
if(group_name == group_candidate['name']):
idx = group_candidate['id']
self.group_id = idx
web_url = resp.json()[0]['web_url']
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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment