From 56e8a0053e35718f634586bdb14f066c65fad104 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Sat, 29 Aug 2020 14:28:27 +0200 Subject: pdf download on mobile --- client/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/views.py b/client/views.py index 57747ee..cb595e8 100644 --- a/client/views.py +++ b/client/views.py @@ -2,7 +2,7 @@ from random import randint from django.contrib.auth.models import Group, Permission, User from client.models import UserCode, Keys, DocumentType, Document, PersonalData, KeyVal, MedicalData from django.db.models import Q -from django.http import HttpResponseRedirect, FileResponse +from django.http import HttpResponseRedirect, FileResponse, HttpResponse from django.contrib.auth.decorators import login_required from django.shortcuts import render @@ -53,6 +53,7 @@ def index(request): filename = document.document_type.name + ".pdf" response = HttpResponse(pdf, content_type='application/pdf') response['Content-Disposition'] = 'attachment; filename="' + filename + '"' + response['Content-Length'] = len(pdf) return response elif request.POST["action"][0] == 'a': # sign autosign doc -- cgit v1.2.1