Display invoices as inline PDF

They are not user-controllable enough to cause any harm here
This commit is contained in:
Raphael Michel
2019-07-16 09:16:33 +02:00
parent 8d674965d1
commit fb1f6c65af
2 changed files with 4 additions and 2 deletions

View File

@@ -1118,7 +1118,8 @@ class InvoiceDownload(EventPermissionRequiredMixin, View):
invoice_pdf_task.apply(args=(self.invoice.pk,))
return self.get(request, *args, **kwargs)
resp['Content-Disposition'] = 'attachment; filename="{}.pdf"'.format(self.invoice.number)
resp['Content-Disposition'] = 'inline; filename="{}.pdf"'.format(self.invoice.number)
resp._csp_ignore = True # Some browser's PDF readers do not work with CSP
return resp