Author: mtredinnick
Date: 2007-06-14 20:53:40 -0500 (Thu, 14 Jun 2007)
New Revision: 5472
Modified:
django/trunk/django/contrib/auth/__init__.py
Log:
Fixed #4015 -- Changed login() and logout() messages to update request.user if
it is relevant. Thanks James Bennett, Vinay Sajip and Gary Wilson.
Modified: django/trunk/django/contrib/auth/__init__.py
===================================================================
--- django/trunk/django/contrib/auth/__init__.py 2007-06-15 00:26:30 UTC
(rev 5471)
+++ django/trunk/django/contrib/auth/__init__.py 2007-06-15 01:53:40 UTC
(rev 5472)
@@ -53,6 +53,8 @@
user.save()
request.session[SESSION_KEY] = user.id
request.session[BACKEND_SESSION_KEY] = user.backend
+ if hasattr(request, 'user'):
+ request.user = user
def logout(request):
"""
@@ -66,6 +68,9 @@
del request.session[BACKEND_SESSION_KEY]
except KeyError:
pass
+ if hasattr(request, 'user'):
+ from django.contrib.auth.models import AnonymousUser
+ request.user = AnonymousUser()
def get_user(request):
from django.contrib.auth.models import AnonymousUser
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---