Ticket #3379: last_login.diff

File last_login.diff, 707 bytes (added by arvin, 18 years ago)

patch to update last_login during login

  • django/contrib/auth/__init__.py

     
    11from django.core.exceptions import ImproperlyConfigured
     2import datetime
    23
    34SESSION_KEY = '_auth_user_id'
    45BACKEND_SESSION_KEY = '_auth_user_backend'
     
    4849    """
    4950    if user is None:
    5051        user = request.user
     52    user.last_login = datetime.datetime.now()
     53    user.save()
    5154    # TODO: It would be nice to support different login methods, like signed cookies.
    5255    request.session[SESSION_KEY] = user.id
    5356    request.session[BACKEND_SESSION_KEY] = user.backend
Back to Top