code: def validate_username(username):
          
          try:
              validate_slug(username)
          except ValidationError:
              username = slugify(username)
  
          user_model_cls = get_user_model()
          _username = username
          while user_model_cls.objects.filter(username=_username).exists():
              _username = '{}{}'.format(username, random.randint(1, 100))
  
          return _username
docs: This validation step is done when we are sure the user
          does not exit on the systems and we need to create a new user.