# getting passed in the headers, then the correct user is already
# persisted in the session and we don't need to continue.
- if request.user.get_username() == self.clean_username(username, request):
+ if hasattr(request.user, "get_username"):
+ authenticated_username = request.user.get_username()
+ authenticated_username = request.user.username
+ if authenticated_username == self.clean_username(username, request):
# We are seeing this user for the first time in this session, attempt
# to authenticate the user.