Added logs

added username log if unable to authenticate
newly created user for 1st time while its
account is still inactive.
Purpose of log is to find specific useranme
inorder to investigagte LERANER-6026
This commit is contained in:
adeelehsan
2019-01-15 15:10:02 +05:00
parent 74a47cdaa8
commit 2390966e9b

View File

@@ -415,6 +415,8 @@ def authenticate_new_user(request, username, password):
password = normalize_password(password)
backend = load_backend(NEW_USER_AUTH_BACKEND)
user = backend.authenticate(request=request, username=username, password=password)
if not user:
log.warning("Unable to authenticate user: {username}".format(username=username))
user.backend = NEW_USER_AUTH_BACKEND
return user