Fix EnsureUserOwnsOrderMixin
This commit is contained in:
parent
e56c301a90
commit
94b473b1dd
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue