Ticket #3379: last_login.diff
File last_login.diff, 707 bytes (added by , 18 years ago) |
---|
-
django/contrib/auth/__init__.py
1 1 from django.core.exceptions import ImproperlyConfigured 2 import datetime 2 3 3 4 SESSION_KEY = '_auth_user_id' 4 5 BACKEND_SESSION_KEY = '_auth_user_backend' … … 48 49 """ 49 50 if user is None: 50 51 user = request.user 52 user.last_login = datetime.datetime.now() 53 user.save() 51 54 # TODO: It would be nice to support different login methods, like signed cookies. 52 55 request.session[SESSION_KEY] = user.id 53 56 request.session[BACKEND_SESSION_KEY] = user.backend