Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

0.95-bugfixes: Apply fix to LazyUser from [3754]

git-svn-id: http://code.djangoproject.com/svn/django/branches/0.95-bugfixes@4361 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e89f0a65581f82a5740bfe989136cea75d09cd67 1 parent a132d41
James Bennett ubernostrum authored

Showing 1 changed file with 3 additions and 6 deletions. Show diff stats Hide diff stats

  1. +3 6 django/contrib/auth/middleware.py
9 django/contrib/auth/middleware.py
... ... @@ -1,12 +1,9 @@
1 1 class LazyUser(object):
2   - def __init__(self):
3   - self._user = None
4   -
5 2 def __get__(self, request, obj_type=None):
6   - if self._user is None:
  3 + if not hasattr(request, '_cached_user'):
7 4 from django.contrib.auth import get_user
8   - self._user = get_user(request)
9   - return self._user
  5 + request._cached_user = get_user(request)
  6 + return request._cached_user
10 7
11 8 class AuthenticationMiddleware(object):
12 9 def process_request(self, request):

0 comments on commit e89f0a6

Please sign in to comment.
Something went wrong with that request. Please try again.