fix creditnote pdf download

This commit is contained in:
Thomas Steen Rasmussen 2016-06-19 22:04:24 +02:00
parent ac64d9d555
commit 11cb0d453f

View file

@ -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