mirror of
https://github.com/pretix/pretix.git
synced 2026-03-03 10:52:26 +00:00
Compare commits
1 Commits
error-back
...
pdf-not-re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a59a1b02d8 |
@@ -148,6 +148,10 @@ class NumberedCanvas(Canvas):
|
|||||||
self.restoreState()
|
self.restoreState()
|
||||||
|
|
||||||
|
|
||||||
|
class InvoiceNotReadyException(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class BaseInvoiceRenderer:
|
class BaseInvoiceRenderer:
|
||||||
"""
|
"""
|
||||||
This is the base class for all invoice renderers.
|
This is the base class for all invoice renderers.
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ from django_scopes import scope, scopes_disabled
|
|||||||
from i18nfield.strings import LazyI18nString
|
from i18nfield.strings import LazyI18nString
|
||||||
|
|
||||||
from pretix.base.i18n import language
|
from pretix.base.i18n import language
|
||||||
|
from pretix.base.invoicing.pdf import InvoiceNotReadyException
|
||||||
from pretix.base.invoicing.transmission import (
|
from pretix.base.invoicing.transmission import (
|
||||||
get_transmission_types, transmission_providers,
|
get_transmission_types, transmission_providers,
|
||||||
)
|
)
|
||||||
@@ -504,7 +505,7 @@ def generate_invoice(order: Order, trigger_pdf=True):
|
|||||||
return invoice
|
return invoice
|
||||||
|
|
||||||
|
|
||||||
@app.task(base=TransactionAwareTask)
|
@app.task(base=TransactionAwareTask, throws=(InvoiceNotReadyException,))
|
||||||
def invoice_pdf_task(invoice: int):
|
def invoice_pdf_task(invoice: int):
|
||||||
with scopes_disabled():
|
with scopes_disabled():
|
||||||
i = Invoice.objects.get(pk=invoice)
|
i = Invoice.objects.get(pk=invoice)
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
<h1>{% trans "Not found" %}</h1>
|
<h1>{% trans "Not found" %}</h1>
|
||||||
<p>{% trans "I'm afraid we could not find the the resource you requested." %}</p>
|
<p>{% trans "I'm afraid we could not find the the resource you requested." %}</p>
|
||||||
<p>{{ exception }}</p>
|
<p>{{ exception }}</p>
|
||||||
|
<p class="links">
|
||||||
|
<a id='goback' href='#'>{% trans "Take a step back" %}</a>
|
||||||
|
</p>
|
||||||
{% if request.user.is_staff and not staff_session %}
|
{% if request.user.is_staff and not staff_session %}
|
||||||
<form action="{% url 'control:user.sudo' %}?next={{ request.path|add:"?"|add:request.GET.urlencode|urlencode }}" method="post">
|
<form action="{% url 'control:user.sudo' %}?next={{ request.path|add:"?"|add:request.GET.urlencode|urlencode }}" method="post">
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in New Issue
Block a user