def validate_username(username):
        """
        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.
        """
        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
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.