diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2022-08-07 11:05:03 +0200 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2022-08-07 11:05:03 +0200 |
commit | c4ccf8af5f82c359bbe79538d8e745e21f17f06a (patch) | |
tree | b0bd6b80d1d913d6727bd57476fb1eae3e20dbae /client/views.py | |
parent | unified approve doc page (diff) | |
download | scout-subs-c4ccf8af5f82c359bbe79538d8e745e21f17f06a.tar.gz scout-subs-c4ccf8af5f82c359bbe79538d8e745e21f17f06a.zip |
add qr code to pdf approve, direct approval page
Diffstat (limited to '')
-rw-r--r-- | client/views.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/client/views.py b/client/views.py index 86142ef..3ddc417 100644 --- a/client/views.py +++ b/client/views.py @@ -1,5 +1,6 @@ from django.db.models.expressions import OuterRef, Subquery from django.template.loader import get_template +from django.urls import reverse from client.models import GroupSettings, UserCode, Keys, DocumentType, Document, PersonalData, KeyVal, MedicalData from django.db.models import Q from django.http import HttpResponse, HttpResponseRedirect, FileResponse @@ -57,7 +58,7 @@ def index(request): if request.POST["action"][0] == 'f': # generate approve pdf template = get_template('client/approve_doc_pdf.html') - context = {'doc': document} + context = {'doc': document, 'uri': request.build_absolute_uri(reverse('approve_direct')) + "?code=" + str(document.code)} html = template.render(context) pdf = pdfkit.from_string(html, False) result = BytesIO(pdf) |