Search group
This commit is contained in:
parent
5504cacb37
commit
3b9012880b
1 changed files with 6 additions and 4 deletions
|
@ -71,12 +71,14 @@ def create_tutorial(course, group):
|
||||||
|
|
||||||
def create_course(course_name):
|
def create_course(course_name):
|
||||||
|
|
||||||
try:
|
courses = gl.groups.list(search=course_name)
|
||||||
|
course = None
|
||||||
|
|
||||||
|
if len(courses) == 0:
|
||||||
path = course_name.replace(' ', '_').lower()
|
path = course_name.replace(' ', '_').lower()
|
||||||
course = gl.groups.create({'name': course_name, 'path': path})
|
course = gl.groups.create({'name': course_name, 'path': path})
|
||||||
except:
|
else:
|
||||||
# TODO implement search method in python-gitlab for API v4
|
course = courses[0]
|
||||||
course = gl.groups.get(id=34)
|
|
||||||
|
|
||||||
return course
|
return course
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue