diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-12-12 17:53:32 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-12-12 17:53:32 +0000 |
| commit | c1a8bd6779c2ff907d2d80b98d79c8ab10d642ae (patch) | |
| tree | 408c4b2d524753112faae2ca421352bcf0129f5d /django/utils/functional.py | |
| parent | 5e6c3d24b31af8af5514c6b7ecf700ae7836eef8 (diff) | |
[1.1.X] Fixed #10130: you may now delete attributes on `settings`. Thanks, jcassee.
Backport of r11824.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@11825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/functional.py')
| -rw-r--r-- | django/utils/functional.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py index 65a9b9d7aa..e6dbeb32e0 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -280,6 +280,13 @@ class LazyObject(object): self._setup() setattr(self._wrapped, name, value) + def __delattr__(self, name): + if name == "_wrapped": + raise TypeError("can't delete _wrapped.") + if self._wrapped is None: + self._setup() + delattr(self._wrapped, name) + def _setup(self): """ Must be implemented by subclasses to initialise the wrapped object. |
