parameters: (self, request, *args, **kwargs)
return_statement: return super(BaseAddUserToGroup, self).dispatch(request, *args, **kwargs)
docstring: Before handling a post or get request, make sure that the target user is allowed to be added to the given group.
docstring_summary: Before handling a post or get request, make sure that the target user is allowed to be added to the given group.
docstring_tokens: Before handling a post or get request make sure that the target user is allowed to be added to the given group .
function: 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)
function_tokens: 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 )