diff --git a/api/views/vak.py b/api/views/vak.py index 8bf5898b..51115694 100644 --- a/api/views/vak.py +++ b/api/views/vak.py @@ -4,7 +4,7 @@ from django.shortcuts import redirect from api.models.vak import Vak -from api.serializers.vak import VakSerializer +from api.serializers.vak import VakSerializer, add_students_to_group from api.utils import has_permissions, is_lesgever, get_gebruiker @@ -116,4 +116,6 @@ def vak_detail_accept_invite(request, id, format=None): vak.studenten.add(gebruiker) vak.save() + add_students_to_group(vak) + return redirect("vak_detail", id=vak.vak_id)