mirror of
https://github.com/django/django.git
synced 2025-09-18 00:10:22 +00:00
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:
parent
4531767700
commit
1cfb00dc41
3 changed files with 17 additions and 36 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue