Skip to content

Commit

Permalink
fix: revert invoice links fix (11da737)
Browse files Browse the repository at this point in the history
  • Loading branch information
henri-hulski committed Apr 8, 2022
1 parent 9251acc commit e8dd08f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cartridge/shop/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def invoice(self):
Returns the HTML for a link to the PDF invoice for use in the
order listing view of the admin.
"""
url = reverse("shop:shop_invoice", args=(self.id,))
url = reverse("shop_invoice", args=(self.id,))
text = gettext("Download PDF invoice")
return mark_safe(f"<a href='{url}?format=pdf'>{text}</a>")

Expand Down
2 changes: 1 addition & 1 deletion cartridge/shop/templates/admin/shop/order/change_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

{% block object-tools-items %}
{% if change and has_pdf %}
<li><a href="{% url "shop:shop_invoice" object_id %}?format=pdf">{% trans "Download PDF invoice" %}</a></li>
<li><a href="{% url "shop_invoice" object_id %}?format=pdf">{% trans "Download PDF invoice" %}</a></li>
{% endif %}
<li><a href="#" onclick="document.getElementById('resend-email').submit(); return false;">{% trans "Re-send order email" %}</a></li>
{{ block.super }}
Expand Down
3 changes: 1 addition & 2 deletions cartridge/shop/templates/shop/complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<li><strong>{% trans "Complete" %}</strong></li>
{% endblock %}


{% block main %}
<p>{% trans "Thank you for shopping with us! Your order is complete." %}</p>
<p>{% trans "We've sent you a receipt via email." %}</p>
Expand All @@ -67,7 +66,7 @@
<form class="order-complete-form" method="post" action="{% url "shop_invoice_resend" order.id %}?next={{ request.path }}">
{% csrf_token %}
{% if has_pdf %}
<a class="btn btn-primary" href="{% url "shop:shop_invoice" order.id %}?format=pdf">{% trans "Download PDF invoice" %}</a>
<a class="btn btn-primary" href="{% url "shop_invoice" order.id %}?format=pdf">{% trans "Download PDF invoice" %}</a>
{% endif %}
<a class="btn btn-default" target="_blank" href="{% url "shop_invoice" order.id %}">{% trans "View invoice in your browser" %}</a>
<input type="submit" class="btn btn-default" value="{% trans "Re-send order email" %}">
Expand Down

0 comments on commit e8dd08f

Please sign in to comment.