diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-02-13 06:06:09 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-02-13 06:06:09 +0000 |
| commit | ba9649f966e7bf9c1f0cea7fac2bb991beb600b5 (patch) | |
| tree | eafd4fcae68229cba344274cb1223351cbb65eee /django | |
| parent | a4ddecd15c1ea38a7827426f73ddd997786d42cd (diff) | |
Fixed #3377 -- Fixed subtle infinite recursion bug in LazyDate objects. Thanks
to brut.alll@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/models/__init__.py b/django/db/models/__init__.py index 0308dd047a..47057e306f 100644 --- a/django/db/models/__init__.py +++ b/django/db/models/__init__.py @@ -50,4 +50,9 @@ class LazyDate(object): return (datetime.datetime.now() + self.delta).date() def __getattr__(self, attr): + if attr == 'delta': + # To fix ticket #3377. Note that normal access to LazyDate.delta + # (after construction) will still work, because they don't go + # through __getattr__). This is mainly needed for unpickling. + raise AttributeError return getattr(self.__get_value__(), attr) |
