Skip to content
Snippets Groups Projects
Commit 1b228c66 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Correct the redirect_url used to show a generated PDF printout of a class register

parent af849ace
No related branches found
No related tags found
2 merge requests!325Resolve "Fix PDF generation",!323Prepare release 3.0b0
Pipeline #118892 passed with warnings
...@@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file. ...@@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_, The format is based on `Keep a Changelog`_,
and this project adheres to `Semantic Versioning`_. and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Fixed
~~~~~
* The redirection to generated class register PDF printouts did not work.
`3.0b0`_ - 2022-02-28 `3.0b0`_ - 2022-02-28
--------------------- ---------------------
......
...@@ -642,8 +642,11 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse: ...@@ -642,8 +642,11 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
group = get_object_or_404(Group, pk=id_) group = get_object_or_404(Group, pk=id_)
file_object = PDFFile.objects.create() 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) result = generate_full_register_printout.delay(group.pk, file_object.pk)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment