summaryrefslogtreecommitdiff
path: root/django/contrib/auth/middleware.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2006-06-28 16:37:02 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2006-06-28 16:37:02 +0000
commitaab3a418ac9293bb4abd7670f65d930cb0426d58 (patch)
tree53ab9ed62c0b7a8451355a34d6f1e0fab2f98af0 /django/contrib/auth/middleware.py
parent4ea7a11659b8a0ab07b0d2e847975f7324664f10 (diff)
Merged multi-auth branch to trunk. See the authentication docs for the ramifications of this change. Many, many thanks to Joseph Kocherhans for the hard work!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/auth/middleware.py')
-rw-r--r--django/contrib/auth/middleware.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/django/contrib/auth/middleware.py b/django/contrib/auth/middleware.py
index a1a0b2e834..a6a60780a7 100644
--- a/django/contrib/auth/middleware.py
+++ b/django/contrib/auth/middleware.py
@@ -4,12 +4,8 @@ class LazyUser(object):
def __get__(self, request, obj_type=None):
if self._user is None:
- from django.contrib.auth.models import User, AnonymousUser, SESSION_KEY
- try:
- user_id = request.session[SESSION_KEY]
- self._user = User.objects.get(pk=user_id)
- except (KeyError, User.DoesNotExist):
- self._user = AnonymousUser()
+ from django.contrib.auth import get_user
+ self._user = get_user(request)
return self._user
class AuthenticationMiddleware(object):