diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2c77d1f1345d56cc7d4d7cf2306a5e853e67b2b4..54093096603c53189ce421766aaf9cd82e389ea7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,7 @@ Fixed ~~~~~ * In some cases, pages showing the count of extra marks and lessons with custom excuse types of persons threw an error. +* The redirection to generated class register PDF printouts did not work. `3.0b0`_ - 2022-02-28 --------------------- diff --git a/aleksis/apps/alsijil/views.py b/aleksis/apps/alsijil/views.py index f78ab22097f78ec0e3477000543977f14518d32d..590708deb9c403831def46d4e2f070e1e5fc2893 100644 --- a/aleksis/apps/alsijil/views.py +++ b/aleksis/apps/alsijil/views.py @@ -642,8 +642,11 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse: group = get_object_or_404(Group, pk=id_) file_object = PDFFile.objects.create() + if has_person(request): + file_object.person = request.user.person + file_object.save() - redirect_url = reverse("redirect_to_pdf_file", args=[file_object.pk]) + redirect_url = f"/pdfs/{file_object.pk}" result = generate_full_register_printout.delay(group.pk, file_object.pk)