From 83eb88f86be7751a3457408a20d2067914187698 Mon Sep 17 00:00:00 2001 From: Tim Schubert <mail@timschubert.net> Date: Wed, 17 Oct 2018 11:03:13 +0200 Subject: [PATCH 1/2] Fix: Command invocation for `users` subcommand does not include required option `--course` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8831f02..7a075e7 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Next, since there is currently no API available to export a list of participants This list may of course change from time to time, so make sure to re-run the script regularly. ``` -$ abgabesystem users -s <students.csv> -b <LDAP base domain> -p main +$ abgabesystem users -c <course> -s <students.csv> -b <LDAP base domain> -p main ``` Now create a fork of this repository inside the namespace of the course. From fc53427cad16024d37b5c7b4c927acbf081fe123 Mon Sep 17 00:00:00 2001 From: Tim Schubert <mail@timschubert.net> Date: Wed, 17 Oct 2018 11:27:07 +0200 Subject: [PATCH 2/2] Fix: https://github.com/timschubert/abgabesystem/issues/4#issuecomment-430551541 --- src/abgabesystem/projects.py | 4 ++-- src/abgabesystem/students.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/abgabesystem/projects.py b/src/abgabesystem/projects.py index 8826fbb..a2da564 100644 --- a/src/abgabesystem/projects.py +++ b/src/abgabesystem/projects.py @@ -3,7 +3,7 @@ import logging as log from gitlab import DEVELOPER_ACCESS from gitlab.exceptions import GitlabError, GitlabCreateError from .students import enrolled_students -from .course import InvalidCourse +from .course import InvalidCourse, create_solutions_group def create_tag(project, tag, ref): @@ -144,7 +144,7 @@ def setup_projects(gl, course, deploy_key): solutions = gl.groups.get(group.id) if solutions is None: - raise InvalidCourse("No solutions subgroup") + solutions = create_solutions_group(gl, course) reference_project = None reference_projects = solutions.projects.list(search='solutions') diff --git a/src/abgabesystem/students.py b/src/abgabesystem/students.py index 4c86889..e25a534 100644 --- a/src/abgabesystem/students.py +++ b/src/abgabesystem/students.py @@ -137,7 +137,7 @@ def get_student_group(gl, course_name): students_group = gl.groups.get(g.id) if students_group is None: - raise MissingStudentsGroup() + students_group = create_students_group(gl, course) return students_group