Fix EnsureUserOwnsOrderMixin

This commit is contained in:
Víðir Valberg Guðmundsson 2016-05-31 23:30:18 +02:00
parent e56c301a90
commit 94b473b1dd

View file

@ -45,7 +45,8 @@ class EnsureUserOwnsOrderMixin(SingleObjectMixin):
def dispatch(self, request, *args, **kwargs):
# If the user does not own this ticket OR is not staff
if self.get_object().user != request.user or not request.user.is_staff:
if not request.user.is_staff:
if self.get_object().user != request.user:
raise Http404("Order not found")
return super(EnsureUserOwnsOrderMixin, self).dispatch(