(self, *args, **kwargs)
return super(OwnerRequiredMixin, self).dispatch(*args, **kwargs)
Only owners can manage organizations.
Only owners can manage organizations.
Only owners can manage organizations .
def dispatch(self, *args, **kwargs):
        """Only owners can manage organizations."""
        organization = self.get_object()
        if self.request.user != organization.created_by \
                and not self.request.user.is_superuser:
            raise Http404
        return super(OwnerRequiredMixin, self).dispatch(*args, **kwargs)
def dispatch ( self , * args , * * kwargs ) : organization = self . get_object ( ) if self . request . user != organization . created_by and not self . request . user . is_superuser : raise Http404 return super ( OwnerRequiredMixin , self ) . dispatch ( * args , * * kwargs )