.invoice.pdf

This commit is contained in:
Thomas Steen Rasmussen 2016-05-31 00:00:57 +02:00
parent 7936a931b1
commit 093f9bddf9

View file

@ -273,7 +273,7 @@ class DownloadInvoiceView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, EnsurePa
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
response = HttpResponse(content_type='application/pdf') response = HttpResponse(content_type='application/pdf')
response['Content-Disposition'] = 'attachment; filename="%s"' % self.get_object().invoice.filename response['Content-Disposition'] = 'attachment; filename="%s"' % self.get_object().invoice.filename
response.write(self.get_object().pdf.read()) response.write(self.get_object().invoice.pdf.read())
return response return response
################################################################################# #################################################################################