mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Remove unused download of all tickets of an order in pretix-control (#6086)
* Remove unused code for ticket download of whole order in pretix-control * fix flake8 * fix isort
This commit is contained in:
committed by
GitHub
parent
1c7ce4b1ca
commit
217744a9f2
@@ -79,9 +79,9 @@ from pretix.base.email import get_email_context
|
|||||||
from pretix.base.exporter import MultiSheetListExporter
|
from pretix.base.exporter import MultiSheetListExporter
|
||||||
from pretix.base.i18n import language
|
from pretix.base.i18n import language
|
||||||
from pretix.base.models import (
|
from pretix.base.models import (
|
||||||
CachedCombinedTicket, CachedFile, CachedTicket, Checkin, Invoice,
|
CachedFile, CachedTicket, Checkin, Invoice, InvoiceAddress, Item,
|
||||||
InvoiceAddress, Item, ItemVariation, LogEntry, Order, QuestionAnswer,
|
ItemVariation, LogEntry, Order, QuestionAnswer, Quota,
|
||||||
Quota, ScheduledEventExport, generate_secret,
|
ScheduledEventExport, generate_secret,
|
||||||
)
|
)
|
||||||
from pretix.base.models.orders import (
|
from pretix.base.models.orders import (
|
||||||
CancellationRequest, OrderFee, OrderPayment, OrderPosition, OrderRefund,
|
CancellationRequest, OrderFee, OrderPayment, OrderPosition, OrderRefund,
|
||||||
@@ -718,30 +718,13 @@ class OrderDownload(AsyncAction, OrderView):
|
|||||||
),
|
),
|
||||||
content_type=value.type
|
content_type=value.type
|
||||||
)
|
)
|
||||||
elif isinstance(value, CachedCombinedTicket):
|
|
||||||
if value.type == 'text/uri-list':
|
|
||||||
resp = HttpResponseRedirect(value.file.file.read())
|
|
||||||
return resp
|
|
||||||
else:
|
|
||||||
return FileResponse(
|
|
||||||
value.file.file,
|
|
||||||
filename='{}-{}-{}{}'.format(
|
|
||||||
self.request.event.slug.upper(), self.order.code, self.output.identifier, value.extension
|
|
||||||
),
|
|
||||||
content_type=value.type
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
return redirect(self.get_self_url())
|
return redirect(self.get_self_url())
|
||||||
|
|
||||||
def get_last_ct(self):
|
def get_last_ct(self):
|
||||||
if 'position' in self.kwargs:
|
ct = CachedTicket.objects.filter(
|
||||||
ct = CachedTicket.objects.filter(
|
order_position=self.order_position, provider=self.output.identifier, file__isnull=False
|
||||||
order_position=self.order_position, provider=self.output.identifier, file__isnull=False
|
).last()
|
||||||
).last()
|
|
||||||
else:
|
|
||||||
ct = CachedCombinedTicket.objects.filter(
|
|
||||||
order=self.order, provider=self.output.identifier, file__isnull=False
|
|
||||||
).last()
|
|
||||||
if not ct or not ct.file:
|
if not ct or not ct.file:
|
||||||
return None
|
return None
|
||||||
return ct
|
return ct
|
||||||
|
|||||||
Reference in New Issue
Block a user