Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Bug fix: add .PDF extension to PDFs
NyanKiyoshib8fe30ba3eaf
diff --git a/saleor/dashboard/order/views.py b/saleor/dashboard/order/views.pyindex 47848ee803..c9c106b160 100644--- a/saleor/dashboard/order/views.py+++ b/saleor/dashboard/order/views.py@@ -516,7 +516,7 @@ def order_invoice(request, order_pk):absolute_url = get_statics_absolute_url(request)pdf_file, order = create_invoice_pdf(order, absolute_url)response = HttpResponse(pdf_file, content_type='application/pdf')- name = "invoice-%s" % order.id+ name = "invoice-%s.pdf" % order.idresponse['Content-Disposition'] = 'filename=%s' % namereturn response@@ -556,7 +556,7 @@ def fulfillment_packing_slips(request, order_pk, fulfillment_pk):absolute_url = get_statics_absolute_url(request)pdf_file, order = create_packing_slip_pdf(order, fulfillment, absolute_url)response = HttpResponse(pdf_file, content_type='application/pdf')- name = "packing-slip-%s" % (order.id,)+ name = "packing-slip-%s.pdf" % (order.id,)response['Content-Disposition'] = 'filename=%s' % namereturn responsediff --git a/tests/dashboard/test_order.py b/tests/dashboard/test_order.pyindex 4bf5811f6e..dbf00294fe 100644--- a/tests/dashboard/test_order.py+++ b/tests/dashboard/test_order.py@@ -551,7 +551,7 @@ def test_view_order_invoice(admin_client, order_with_lines):response = admin_client.get(url)assert response.status_code == 200assert response['content-type'] == 'application/pdf'- name = "invoice-%s" % order_with_lines.id+ name = "invoice-%s.pdf" % order_with_lines.idassert response['Content-Disposition'] == 'filename=%s' % name@@ -577,7 +577,7 @@ def test_view_fulfillment_packing_slips(admin_client, fulfilled_order):response = admin_client.get(url)assert response.status_code == 200assert response['content-type'] == 'application/pdf'- name = "packing-slip-%s" % (fulfilled_order.id,)+ name = "packing-slip-%s.pdf" % (fulfilled_order.id,)assert response['Content-Disposition'] == 'filename=%s' % name