mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Race conditions can lead to duplicate CachedTickets
This commit is contained in:
@@ -509,9 +509,9 @@ class OrderDownload(EventViewMixin, OrderDetailMixin, View):
|
|||||||
return redirect(self.get_order_url())
|
return redirect(self.get_order_url())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ct = CachedTicket.objects.get(
|
ct = CachedTicket.objects.filter(
|
||||||
order_position=self.order_position, provider=self.output.identifier
|
order_position=self.order_position, provider=self.output.identifier
|
||||||
)
|
).last()
|
||||||
except CachedTicket.DoesNotExist:
|
except CachedTicket.DoesNotExist:
|
||||||
ct = None
|
ct = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user