Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
Fixup: None type is not subscribable
Browse files Browse the repository at this point in the history
  • Loading branch information
dadada committed Sep 20, 2018
1 parent 12996ba commit 933a8ae
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/abgabesystem/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ def create_project(gl, group, user, reference, deploy_key):
'path': user.username,
'parent_id': group.id
})
except GitlabError as e:
subgroups = group.subgroups.list(search=user.username)
if len(subgroups) > 0 and subgroup[0].name == user.username:
subgroup = subgroups[0]
subgroup = gl.groups.get(subgroup.id, lazy=True)
else:
except GitlabCreateError as e:
for g in group.subgroups.list(search=user.username):
if g.name == user.username:
subgroup = gl.groups.get(g.id, lazy=True)

if subgroup is None:
raise(e)

try:
subgroup.members.create({
'user_id': user.id,
Expand Down

0 comments on commit 933a8ae

Please sign in to comment.