Added username to logging output
This commit is contained in:
6
login.py
6
login.py
@@ -119,16 +119,16 @@ class Infomentor(object):
|
|||||||
)
|
)
|
||||||
with contextlib.suppress(FileNotFoundError):
|
with contextlib.suppress(FileNotFoundError):
|
||||||
self.session.cookies.load(ignore_discard=True, ignore_expires=True)
|
self.session.cookies.load(ignore_discard=True, ignore_expires=True)
|
||||||
if not self.logged_in():
|
if not self.logged_in(user):
|
||||||
self._do_login(user, password)
|
self._do_login(user, password)
|
||||||
|
|
||||||
def logged_in(self):
|
def logged_in(self, username):
|
||||||
ts = math.floor(time.time())
|
ts = math.floor(time.time())
|
||||||
url = self._mim_url(
|
url = self._mim_url(
|
||||||
'authentication/authentication/isauthenticated/?_={}000'.format(ts)
|
'authentication/authentication/isauthenticated/?_={}000'.format(ts)
|
||||||
)
|
)
|
||||||
r = self._do_post(url)
|
r = self._do_post(url)
|
||||||
self.logger.info('loggedin: %s', r.text)
|
self.logger.info('%s loggedin: %s', username, r.text)
|
||||||
return r.text == 'true'
|
return r.text == 'true'
|
||||||
|
|
||||||
def _get_auth_token(self):
|
def _get_auth_token(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user