docs: def dispatch(self, request, *args, **kwargs):
          '''
          This override of dispatch ensures that if no group is required, then
          the request still goes through without being logged in.
          '''
          self.request = request
          in_group = False
          required_group = self.get_group_required()
          if not required_group or required_group == ['']:
              in_group = True
          elif self.request.user.is_authenticated():
              in_group = self.check_membership(required_group)
  
          if not in_group:
              if self.raise_exception:
                  raise PermissionDenied
              else:
                  return redirect_to_login(
                      request.get_full_path(),
                      self.get_login_url(),
                      self.get_redirect_field_name())
          return super(GroupRequiredMixin, self).dispatch(
              request, *args, **kwargs)