

def clean_username(self, username, request):
    '\n        Allows the backend to clean the username, if the backend defines a\n        clean_username method.\n        '
    backend_str = request.session[auth.BACKEND_SESSION_KEY]
    backend = auth.load_backend(backend_str)
    try:
        username = backend.clean_username(username)
    except AttributeError:
        pass
    return username

dataset/ETHPy150Open django/django/django/contrib/auth/middleware.py RemoteUserMiddleware.clean_username/original