Cleaned up how `request.user` is set, this is a follow up to [16297]. Thanks for the review Luke.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor 2011-05-31 15:43:19 +00:00
parent 4531767700
commit 1cfb00dc41
3 changed files with 17 additions and 36 deletions

View file

@ -208,7 +208,7 @@ class LazyObject(object):
def __dir__(self):
if self._wrapped is None:
self._setup()
return dir(self._wrapped)
return dir(self._wrapped)
class SimpleLazyObject(LazyObject):
"""
@ -227,9 +227,7 @@ class SimpleLazyObject(LazyObject):
value.
"""
self.__dict__['_setupfunc'] = func
# For some reason, we have to inline LazyObject.__init__ here to avoid
# recursion
self._wrapped = None
super(SimpleLazyObject, self).__init__()
def __str__(self):
if self._wrapped is None: self._setup()