From 007ae997cb8fa1c80766e8686eac154f022224c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Mon, 29 Aug 2016 16:17:18 +0200 Subject: [PATCH] Raise the exception, not return it. --- shop/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shop/views.py b/shop/views.py index a6fe061a..f9625a9d 100644 --- a/shop/views.py +++ b/shop/views.py @@ -610,7 +610,7 @@ class TicketDetailView(LoginRequiredMixin, UpdateView, DetailView): def dispatch(self, request, *args, **kwargs): ticket = self.get_object() if ticket.order.user != request.user: - return Http404 + raise Http404 return super(TicketDetailView, self).dispatch(request, *args, **kwargs)