Order cancellation: Fix crash on deleted order (PRETIXEU-AHP)

This commit is contained in:
Raphael Michel
2024-09-10 14:00:11 +02:00
parent 667c2555b2
commit 98709286c6

View File

@@ -982,6 +982,11 @@ class OrderCancelDo(EventViewMixin, OrderDetailMixin, AsyncAction, View):
def get_error_url(self):
return self.get_order_url()
def get(self, request, *args, **kwargs):
if not self.order:
raise Http404(_('Unknown order code or not authorized to access this order.'))
return super().get(request, *args, **kwargs)
def post(self, request, *args, **kwargs):
if not self.order:
raise Http404(_('Unknown order code or not authorized to access this order.'))