Fix EnsureUserOwnsOrderMixin
This commit is contained in:
parent
e56c301a90
commit
94b473b1dd
|
@ -45,8 +45,9 @@ class EnsureUserOwnsOrderMixin(SingleObjectMixin):
|
||||||
|
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
# If the user does not own this ticket OR is not staff
|
# 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:
|
||||||
raise Http404("Order not found")
|
if self.get_object().user != request.user:
|
||||||
|
raise Http404("Order not found")
|
||||||
|
|
||||||
return super(EnsureUserOwnsOrderMixin, self).dispatch(
|
return super(EnsureUserOwnsOrderMixin, self).dispatch(
|
||||||
request, *args, **kwargs
|
request, *args, **kwargs
|
||||||
|
|
Loading…
Reference in a new issue