From 12996bae48d0d158a2d609af875a735e7cc5d9cb Mon Sep 17 00:00:00 2001 From: Tim Schubert Date: Thu, 20 Sep 2018 16:50:44 +0200 Subject: [PATCH] Implement enroll student function --- src/abgabesystem/students.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/abgabesystem/students.py b/src/abgabesystem/students.py index 746c028..3ff440f 100644 --- a/src/abgabesystem/students.py +++ b/src/abgabesystem/students.py @@ -1,6 +1,8 @@ import csv import secrets +from gitlab import GUEST_ACCESS + class MissingStudentsGroup(Exception): pass @@ -104,8 +106,11 @@ def get_student_group(gl, course_name): return students_group -def enroll_student(gl, user, group): +def enroll_student(gl, user, subgroup): """Adds a student to the course """ - pass + subgroup.members.create({ + 'user_id': user.id, + 'access_level': GUEST_ACCESS, + })