Correcting user name in logging

This commit is contained in:
Léo 2019-01-24 20:13:35 +01:00
parent f1ed7575ff
commit be0a5f5e99

View File

@ -147,7 +147,7 @@ class SAuth(object):
if(user is not None):
pw=user.password
if pw is None or not len(pw.split('/'))==3 :
logger.warn("Login FAIL user {} from {}".format(user, ip))
logger.warn("Login FAIL user {} from {}".format(username, ip))
_redirect(fail_redirect)
return False
pw=pw.split('/')
@ -158,11 +158,11 @@ class SAuth(object):
if(pw[2]==pwtest):
get_session()['username']=username
get_session()['roles']=self.get_user_roles(username)
logger.info("Login OK user {} from {}".format(user, ip))
logger.info("Login OK user {} from {}".format(username, ip))
if(success_redirect is not None):
_redirect(success_redirect)
return True
logger.warn("Login FAIL user {} from {}".format(user, ip))
logger.warn("Login FAIL user {} from {}".format(username, ip))
_redirect(fail_redirect)
return False