(self, request, *args, **kwargs)
return super(BaseAddUserToGroup, self).dispatch(request, *args, **kwargs)
Before handling a post or get request, make sure that the target user is allowed to be added to the given group.
Before handling a post or get request, make sure that the target user is allowed to be added to the given group.
Before handling a post or get request make sure that the target user is allowed to be added to the given group .
def dispatch(self, request, *args, **kwargs):
        """ Before handling a post or get request, make sure that the target user is allowed to be added to the given group. """
        self.object = self.get_object()
        self.is_new = self.object is None
        valid, error_message = self.target_user_valid()
        if not valid:
            self.extra_context['error_message'] = error_message
            return self.form_invalid(None)
        return super(BaseAddUserToGroup, self).dispatch(request, *args, **kwargs)
def dispatch ( self , request , * args , * * kwargs ) : self . object = self . get_object ( ) self . is_new = self . object is None valid , error_message = self . target_user_valid ( ) if not valid : self . extra_context [ 'error_message' ] = error_message return self . form_invalid ( None ) return super ( BaseAddUserToGroup , self ) . dispatch ( request , * args , * * kwargs )