Race conditions can lead to duplicate CachedTickets

This commit is contained in:
Raphael Michel
2016-12-23 11:02:29 +01:00
parent 0082216d75
commit 873c7dc65d

View File

@@ -509,9 +509,9 @@ class OrderDownload(EventViewMixin, OrderDetailMixin, View):
return redirect(self.get_order_url())
try:
ct = CachedTicket.objects.get(
ct = CachedTicket.objects.filter(
order_position=self.order_position, provider=self.output.identifier
)
).last()
except CachedTicket.DoesNotExist:
ct = None