From 11cb0d453f4e23fee701866bb98ae1cff5eedb26 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Sun, 19 Jun 2016 22:04:24 +0200 Subject: [PATCH] fix creditnote pdf download --- shop/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shop/views.py b/shop/views.py index 60339295..3138e0ae 100644 --- a/shop/views.py +++ b/shop/views.py @@ -348,7 +348,6 @@ class DownloadInvoiceView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, EnsurePa return response - class CreditNoteListView(LoginRequiredMixin, ListView): model = CreditNote template_name = "creditnote_list.html" @@ -361,7 +360,7 @@ class DownloadCreditNoteView(LoginRequiredMixin, EnsureUserOwnsCreditNoteMixin, def get(self, request, *args, **kwargs): response = HttpResponse(content_type='application/pdf') response['Content-Disposition'] = 'attachment; filename="%s"' % self.get_object().filename - response.write(self.get_object().invoice.pdf.read()) + response.write(self.get_object().pdf.read()) return response