def no_such_user(request): """Validator that an user does not exist.""" username = request.swagger_data['user']['username'] if not User.is_username_available(username): raise NotAcceptable(detail='User already exist')
def no_such_user(request): """Validator that an user does not exist.""" username = request.swagger_data['user']['username'] if not User.is_username_available(username): raise AuthenticationError('User already exist')