def dispatch(self, *args, **kwargs): if not is_in_branch(self.request.user, self.get_object().branch): return refuse(self.request) if not self.request.user.is_superuser and self.request.user in self.get_object( ).receiver.ignore_list.all(): return refuse(self.request) return super(DetailDemandView, self).dispatch(*args, **kwargs)
def dispatch(self, *args, **kwargs): if not is_in_branch(self.request.user, self.get_object().branch): return refuse(self.request) return super(DetailOfferView, self).dispatch(*args, **kwargs)
def dispatch(self, *args, **kwargs): if not is_in_branch(User.objects.get(pk=self.kwargs['user_id']), Branch.objects.get(pk=self.kwargs['branch_id'])): return refuse(self.request) return super(CreateOfferView, self).dispatch(*args, **kwargs)
def dispatch(self, *args, **kwargs): if not is_in_branch(self.request.user, self.get_object().branch): return refuse(self.request) if not self.request.user.is_superuser and self.request.user in self.get_object().receiver.ignore_list.all(): return refuse(self.request) return super(DetailDemandView, self).dispatch(*args, **kwargs)