utils.py: log a message on login

This commit is contained in:
Benjamin Dauvergne 2015-04-09 15:08:24 +02:00
parent 6491033c80
commit 3ce5595074
1 changed files with 1 additions and 0 deletions

View File

@ -275,6 +275,7 @@ def record_authentication_event(request, how):
'''Record an authentication event in the session and in the database, in
later version the database persistence can be removed'''
from . import models
logging.getLogger(__name__).info('logged in (%s)', how)
authentication_events = request.session.setdefault(constants.AUTHENTICATION_EVENTS_SESSION_KEY, [])
# As we update a persistent object and not a session key we must
# explicitly state that the session has been modified