prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Saleor eCommerce, Mirumee Software in pdf
  ### What I'm trying to achieve
  Make pdf with my custom name instead of Saleor eCommerce, Mirumee Software
  
  ### Steps to reproduce the problem
  make order and fullfill and make pdf
  ### What I expected to happen
  My brand new ecommerce company
  
  ### Screenshots
  <!-- If applicable, add screenshots to help explain your problem. -->
  <img width="1207" alt="schermafbeelding 2018-12-22 om 13 35 35" src="https://user-images.githubusercontent.com/7673074/50374426-8b5d1780-05ee-11e9-81cf-f778935a403b.png">
  
  **System information**
  Operating system: 
  Browser:
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `saleor/dashboard/order/utils.py`
  Content:
  ```
  1 from django.conf import settings
  2 from django.contrib.sites.shortcuts import get_current_site
  3 from django.template.loader import get_template
  4 
  5 from ...checkout import AddressType
  6 from ...checkout.utils import _get_products_voucher_discount
  7 from ...core.utils.taxes import ZERO_MONEY
  8 from ...discount import VoucherType
  9 from ...discount.utils import (
  10     get_shipping_voucher_discount, get_value_voucher_discount)
  11 from ...product.utils import decrease_stock
  12 
  13 INVOICE_TEMPLATE = 'dashboard/order/pdf/invoice.html'
  14 PACKING_SLIP_TEMPLATE = 'dashboard/order/pdf/packing_slip.html'
  15 
  16 
  17 def get_statics_absolute_url(request):
  18     site = get_current_site(request)
  19     absolute_url = '%(protocol)s://%(domain)s%(static_url)s' % {
  20         'protocol': 'https' if request.is_secure() else 'http',
  21         'domain': site.domain,
  22         'static_url': settings.STATIC_URL}
  23     return absolute_url
  24 
  25 
  26 def _create_pdf(rendered_template, absolute_url):
  27     from weasyprint import HTML
  28     pdf_file = (HTML(string=rendered_template, base_url=absolute_url)
  29                 .write_pdf())
  30     return pdf_file
  31 
  32 
  33 def create_invoice_pdf(order, absolute_url):
  34     ctx = {'order': order}
  35     rendered_template = get_template(INVOICE_TEMPLATE).render(ctx)
  36     pdf_file = _create_pdf(rendered_template, absolute_url)
  37     return pdf_file, order
  38 
  39 
  40 def create_packing_slip_pdf(order, fulfillment, absolute_url):
  41     ctx = {'order': order, 'fulfillment': fulfillment}
  42     rendered_template = get_template(PACKING_SLIP_TEMPLATE).render(ctx)
  43     pdf_file = _create_pdf(rendered_template, absolute_url)
  44     return pdf_file, order
  45 
  46 
  47 def fulfill_order_line(order_line, quantity):
  48     """Fulfill order line with given quantity."""
  49     if order_line.variant and order_line.variant.track_inventory:
  50         decrease_stock(order_line.variant, quantity)
  51     order_line.quantity_fulfilled += quantity
  52     order_line.save(update_fields=['quantity_fulfilled'])
  53 
  54 
  55 def update_order_with_user_addresses(order):
  56     """Update addresses in an order based on a user assigned to an order."""
  57     if order.shipping_address:
  58         order.shipping_address.delete()
  59         order.shipping_address = None
  60 
  61     if order.billing_address:
  62         order.billing_address.delete()
  63         order.billing_address = None
  64 
  65     if order.user:
  66         order.billing_address = (
  67             order.user.default_billing_address.get_copy()
  68             if order.user.default_billing_address else None)
  69         order.shipping_address = (
  70             order.user.default_shipping_address.get_copy()
  71             if order.user.default_shipping_address else None)
  72 
  73     order.save(update_fields=['billing_address', 'shipping_address'])
  74 
  75 
  76 def get_voucher_discount_for_order(order):
  77     """Calculate discount value depending on voucher and discount types.
  78 
  79     Raise NotApplicable if voucher of given type cannot be applied.
  80     """
  81     if not order.voucher:
  82         return ZERO_MONEY
  83     if order.voucher.type == VoucherType.VALUE:
  84         return get_value_voucher_discount(
  85             order.voucher, order.get_subtotal())
  86     if order.voucher.type == VoucherType.SHIPPING:
  87         return get_shipping_voucher_discount(
  88             order.voucher, order.get_subtotal(), order.shipping_price)
  89     if order.voucher.type in (
  90             VoucherType.PRODUCT, VoucherType.COLLECTION, VoucherType.CATEGORY):
  91         return _get_products_voucher_discount(order, order.voucher)
  92     raise NotImplementedError('Unknown discount type')
  93 
  94 
  95 def save_address_in_order(order, address, address_type):
  96     """Save new address of a given address type in an order.
  97 
  98     If the other type of address is empty, copy it.
  99     """
  100     if address_type == AddressType.SHIPPING:
  101         order.shipping_address = address
  102         if not order.billing_address:
  103             order.billing_address = address.get_copy()
  104     else:
  105         order.billing_address = address
  106         if not order.shipping_address:
  107             order.shipping_address = address.get_copy()
  108     order.save(update_fields=['billing_address', 'shipping_address'])
  109 
  110 
  111 def addresses_are_equal(address_1, address_2):
  112     return address_1 and address_2 and address_1 == address_2
  113 
  114 
  115 def remove_customer_from_order(order):
  116     """Remove related customer and user email from order.
  117 
  118     If billing and shipping addresses are set to related customer's default
  119     addresses and were not edited, remove them as well.
  120     """
  121     customer = order.user
  122     order.user = None
  123     order.user_email = ''
  124     order.save()
  125 
  126     if customer:
  127         equal_billing_addresses = addresses_are_equal(
  128             order.billing_address, customer.default_billing_address)
  129         if equal_billing_addresses:
  130             order.billing_address.delete()
  131             order.billing_address = None
  132 
  133         equal_shipping_addresses = addresses_are_equal(
  134             order.shipping_address, customer.default_shipping_address)
  135         if equal_shipping_addresses:
  136             order.shipping_address.delete()
  137             order.shipping_address = None
  138 
  139         if equal_billing_addresses or equal_shipping_addresses:
  140             order.save()
  141
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/saleor/dashboard/order/utils.py b/saleor/dashboard/order/utils.py
  --- a/saleor/dashboard/order/utils.py
  +++ b/saleor/dashboard/order/utils.py
  @@ -1,4 +1,5 @@
   from django.conf import settings
  +from django.contrib.sites.models import Site
   from django.contrib.sites.shortcuts import get_current_site
   from django.template.loader import get_template
   
  @@ -31,14 +32,19 @@
   
   
   def create_invoice_pdf(order, absolute_url):
  -    ctx = {'order': order}
  +    ctx = {
  +        'order': order,
  +        'site': Site.objects.get_current()}
       rendered_template = get_template(INVOICE_TEMPLATE).render(ctx)
       pdf_file = _create_pdf(rendered_template, absolute_url)
       return pdf_file, order
   
   
   def create_packing_slip_pdf(order, fulfillment, absolute_url):
  -    ctx = {'order': order, 'fulfillment': fulfillment}
  +    ctx = {
  +        'order': order,
  +        'fulfillment': fulfillment,
  +        'site': Site.objects.get_current()}
       rendered_template = get_template(PACKING_SLIP_TEMPLATE).render(ctx)
       pdf_file = _create_pdf(rendered_template, absolute_url)
       return pdf_file, order
  
verification_info: {"golden_diff": "diff --git a/saleor/dashboard/order/utils.py b/saleor/dashboard/order/utils.py\n--- a/saleor/dashboard/order/utils.py\n+++ b/saleor/dashboard/order/utils.py\n@@ -1,4 +1,5 @@\n from django.conf import settings\n+from django.contrib.sites.models import Site\n from django.contrib.sites.shortcuts import get_current_site\n from django.template.loader import get_template\n \n@@ -31,14 +32,19 @@\n \n \n def create_invoice_pdf(order, absolute_url):\n-    ctx = {'order': order}\n+    ctx = {\n+        'order': order,\n+        'site': Site.objects.get_current()}\n     rendered_template = get_template(INVOICE_TEMPLATE).render(ctx)\n     pdf_file = _create_pdf(rendered_template, absolute_url)\n     return pdf_file, order\n \n \n def create_packing_slip_pdf(order, fulfillment, absolute_url):\n-    ctx = {'order': order, 'fulfillment': fulfillment}\n+    ctx = {\n+        'order': order,\n+        'fulfillment': fulfillment,\n+        'site': Site.objects.get_current()}\n     rendered_template = get_template(PACKING_SLIP_TEMPLATE).render(ctx)\n     pdf_file = _create_pdf(rendered_template, absolute_url)\n     return pdf_file, order\n", "issue": "Saleor eCommerce, Mirumee Software in pdf\n### What I'm trying to achieve\r\nMake pdf with my custom name instead of Saleor eCommerce, Mirumee Software\r\n\r\n### Steps to reproduce the problem\r\nmake order and fullfill and make pdf\r\n### What I expected to happen\r\nMy brand new ecommerce company\r\n\r\n### Screenshots\r\n<!-- If applicable, add screenshots to help explain your problem. -->\r\n<img width=\"1207\" alt=\"schermafbeelding 2018-12-22 om 13 35 35\" src=\"https://user-images.githubusercontent.com/7673074/50374426-8b5d1780-05ee-11e9-81cf-f778935a403b.png\">\r\n\r\n**System information**\r\nOperating system: \r\nBrowser:\r\n\n", "before_files": [{"content": "from django.conf import settings\nfrom django.contrib.sites.shortcuts import get_current_site\nfrom django.template.loader import get_template\n\nfrom ...checkout import AddressType\nfrom ...checkout.utils import _get_products_voucher_discount\nfrom ...core.utils.taxes import ZERO_MONEY\nfrom ...discount import VoucherType\nfrom ...discount.utils import (\n    get_shipping_voucher_discount, get_value_voucher_discount)\nfrom ...product.utils import decrease_stock\n\nINVOICE_TEMPLATE = 'dashboard/order/pdf/invoice.html'\nPACKING_SLIP_TEMPLATE = 'dashboard/order/pdf/packing_slip.html'\n\n\ndef get_statics_absolute_url(request):\n    site = get_current_site(request)\n    absolute_url = '%(protocol)s://%(domain)s%(static_url)s' % {\n        'protocol': 'https' if request.is_secure() else 'http',\n        'domain': site.domain,\n        'static_url': settings.STATIC_URL}\n    return absolute_url\n\n\ndef _create_pdf(rendered_template, absolute_url):\n    from weasyprint import HTML\n    pdf_file = (HTML(string=rendered_template, base_url=absolute_url)\n                .write_pdf())\n    return pdf_file\n\n\ndef create_invoice_pdf(order, absolute_url):\n    ctx = {'order': order}\n    rendered_template = get_template(INVOICE_TEMPLATE).render(ctx)\n    pdf_file = _create_pdf(rendered_template, absolute_url)\n    return pdf_file, order\n\n\ndef create_packing_slip_pdf(order, fulfillment, absolute_url):\n    ctx = {'order': order, 'fulfillment': fulfillment}\n    rendered_template = get_template(PACKING_SLIP_TEMPLATE).render(ctx)\n    pdf_file = _create_pdf(rendered_template, absolute_url)\n    return pdf_file, order\n\n\ndef fulfill_order_line(order_line, quantity):\n    \"\"\"Fulfill order line with given quantity.\"\"\"\n    if order_line.variant and order_line.variant.track_inventory:\n        decrease_stock(order_line.variant, quantity)\n    order_line.quantity_fulfilled += quantity\n    order_line.save(update_fields=['quantity_fulfilled'])\n\n\ndef update_order_with_user_addresses(order):\n    \"\"\"Update addresses in an order based on a user assigned to an order.\"\"\"\n    if order.shipping_address:\n        order.shipping_address.delete()\n        order.shipping_address = None\n\n    if order.billing_address:\n        order.billing_address.delete()\n        order.billing_address = None\n\n    if order.user:\n        order.billing_address = (\n            order.user.default_billing_address.get_copy()\n            if order.user.default_billing_address else None)\n        order.shipping_address = (\n            order.user.default_shipping_address.get_copy()\n            if order.user.default_shipping_address else None)\n\n    order.save(update_fields=['billing_address', 'shipping_address'])\n\n\ndef get_voucher_discount_for_order(order):\n    \"\"\"Calculate discount value depending on voucher and discount types.\n\n    Raise NotApplicable if voucher of given type cannot be applied.\n    \"\"\"\n    if not order.voucher:\n        return ZERO_MONEY\n    if order.voucher.type == VoucherType.VALUE:\n        return get_value_voucher_discount(\n            order.voucher, order.get_subtotal())\n    if order.voucher.type == VoucherType.SHIPPING:\n        return get_shipping_voucher_discount(\n            order.voucher, order.get_subtotal(), order.shipping_price)\n    if order.voucher.type in (\n            VoucherType.PRODUCT, VoucherType.COLLECTION, VoucherType.CATEGORY):\n        return _get_products_voucher_discount(order, order.voucher)\n    raise NotImplementedError('Unknown discount type')\n\n\ndef save_address_in_order(order, address, address_type):\n    \"\"\"Save new address of a given address type in an order.\n\n    If the other type of address is empty, copy it.\n    \"\"\"\n    if address_type == AddressType.SHIPPING:\n        order.shipping_address = address\n        if not order.billing_address:\n            order.billing_address = address.get_copy()\n    else:\n        order.billing_address = address\n        if not order.shipping_address:\n            order.shipping_address = address.get_copy()\n    order.save(update_fields=['billing_address', 'shipping_address'])\n\n\ndef addresses_are_equal(address_1, address_2):\n    return address_1 and address_2 and address_1 == address_2\n\n\ndef remove_customer_from_order(order):\n    \"\"\"Remove related customer and user email from order.\n\n    If billing and shipping addresses are set to related customer's default\n    addresses and were not edited, remove them as well.\n    \"\"\"\n    customer = order.user\n    order.user = None\n    order.user_email = ''\n    order.save()\n\n    if customer:\n        equal_billing_addresses = addresses_are_equal(\n            order.billing_address, customer.default_billing_address)\n        if equal_billing_addresses:\n            order.billing_address.delete()\n            order.billing_address = None\n\n        equal_shipping_addresses = addresses_are_equal(\n            order.shipping_address, customer.default_shipping_address)\n        if equal_shipping_addresses:\n            order.shipping_address.delete()\n            order.shipping_address = None\n\n        if equal_billing_addresses or equal_shipping_addresses:\n            order.save()\n", "path": "saleor/dashboard/order/utils.py"}], "after_files": [{"content": "from django.conf import settings\nfrom django.contrib.sites.models import Site\nfrom django.contrib.sites.shortcuts import get_current_site\nfrom django.template.loader import get_template\n\nfrom ...checkout import AddressType\nfrom ...checkout.utils import _get_products_voucher_discount\nfrom ...core.utils.taxes import ZERO_MONEY\nfrom ...discount import VoucherType\nfrom ...discount.utils import (\n    get_shipping_voucher_discount, get_value_voucher_discount)\nfrom ...product.utils import decrease_stock\n\nINVOICE_TEMPLATE = 'dashboard/order/pdf/invoice.html'\nPACKING_SLIP_TEMPLATE = 'dashboard/order/pdf/packing_slip.html'\n\n\ndef get_statics_absolute_url(request):\n    site = get_current_site(request)\n    absolute_url = '%(protocol)s://%(domain)s%(static_url)s' % {\n        'protocol': 'https' if request.is_secure() else 'http',\n        'domain': site.domain,\n        'static_url': settings.STATIC_URL}\n    return absolute_url\n\n\ndef _create_pdf(rendered_template, absolute_url):\n    from weasyprint import HTML\n    pdf_file = (HTML(string=rendered_template, base_url=absolute_url)\n                .write_pdf())\n    return pdf_file\n\n\ndef create_invoice_pdf(order, absolute_url):\n    ctx = {\n        'order': order,\n        'site': Site.objects.get_current()}\n    rendered_template = get_template(INVOICE_TEMPLATE).render(ctx)\n    pdf_file = _create_pdf(rendered_template, absolute_url)\n    return pdf_file, order\n\n\ndef create_packing_slip_pdf(order, fulfillment, absolute_url):\n    ctx = {\n        'order': order,\n        'fulfillment': fulfillment,\n        'site': Site.objects.get_current()}\n    rendered_template = get_template(PACKING_SLIP_TEMPLATE).render(ctx)\n    pdf_file = _create_pdf(rendered_template, absolute_url)\n    return pdf_file, order\n\n\ndef fulfill_order_line(order_line, quantity):\n    \"\"\"Fulfill order line with given quantity.\"\"\"\n    if order_line.variant and order_line.variant.track_inventory:\n        decrease_stock(order_line.variant, quantity)\n    order_line.quantity_fulfilled += quantity\n    order_line.save(update_fields=['quantity_fulfilled'])\n\n\ndef update_order_with_user_addresses(order):\n    \"\"\"Update addresses in an order based on a user assigned to an order.\"\"\"\n    if order.shipping_address:\n        order.shipping_address.delete()\n        order.shipping_address = None\n\n    if order.billing_address:\n        order.billing_address.delete()\n        order.billing_address = None\n\n    if order.user:\n        order.billing_address = (\n            order.user.default_billing_address.get_copy()\n            if order.user.default_billing_address else None)\n        order.shipping_address = (\n            order.user.default_shipping_address.get_copy()\n            if order.user.default_shipping_address else None)\n\n    order.save(update_fields=['billing_address', 'shipping_address'])\n\n\ndef get_voucher_discount_for_order(order):\n    \"\"\"Calculate discount value depending on voucher and discount types.\n\n    Raise NotApplicable if voucher of given type cannot be applied.\n    \"\"\"\n    if not order.voucher:\n        return ZERO_MONEY\n    if order.voucher.type == VoucherType.VALUE:\n        return get_value_voucher_discount(\n            order.voucher, order.get_subtotal())\n    if order.voucher.type == VoucherType.SHIPPING:\n        return get_shipping_voucher_discount(\n            order.voucher, order.get_subtotal(), order.shipping_price)\n    if order.voucher.type in (\n            VoucherType.PRODUCT, VoucherType.COLLECTION, VoucherType.CATEGORY):\n        return _get_products_voucher_discount(order, order.voucher)\n    raise NotImplementedError('Unknown discount type')\n\n\ndef save_address_in_order(order, address, address_type):\n    \"\"\"Save new address of a given address type in an order.\n\n    If the other type of address is empty, copy it.\n    \"\"\"\n    if address_type == AddressType.SHIPPING:\n        order.shipping_address = address\n        if not order.billing_address:\n            order.billing_address = address.get_copy()\n    else:\n        order.billing_address = address\n        if not order.shipping_address:\n            order.shipping_address = address.get_copy()\n    order.save(update_fields=['billing_address', 'shipping_address'])\n\n\ndef addresses_are_equal(address_1, address_2):\n    return address_1 and address_2 and address_1 == address_2\n\n\ndef remove_customer_from_order(order):\n    \"\"\"Remove related customer and user email from order.\n\n    If billing and shipping addresses are set to related customer's default\n    addresses and were not edited, remove them as well.\n    \"\"\"\n    customer = order.user\n    order.user = None\n    order.user_email = ''\n    order.save()\n\n    if customer:\n        equal_billing_addresses = addresses_are_equal(\n            order.billing_address, customer.default_billing_address)\n        if equal_billing_addresses:\n            order.billing_address.delete()\n            order.billing_address = None\n\n        equal_shipping_addresses = addresses_are_equal(\n            order.shipping_address, customer.default_shipping_address)\n        if equal_shipping_addresses:\n            order.shipping_address.delete()\n            order.shipping_address = None\n\n        if equal_billing_addresses or equal_shipping_addresses:\n            order.save()\n", "path": "saleor/dashboard/order/utils.py"}]}