def clean_id(self, request):
"""
Allows the backend to clean the user id, if the backend defines a
clean_id method.
"""
backend_str = request.session[auth.BACKEND_SESSION_KEY]
backend = load_backend(backend_str)
try:
user_id = backend.clean_id(request)
except AttributeError: # Backend has no clean_id method.
pass
return user_id
评论列表
文章目录