summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-12-12 17:53:32 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-12-12 17:53:32 +0000
commitc1a8bd6779c2ff907d2d80b98d79c8ab10d642ae (patch)
tree408c4b2d524753112faae2ca421352bcf0129f5d /django
parent5e6c3d24b31af8af5514c6b7ecf700ae7836eef8 (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')
-rw-r--r--django/utils/functional.py7
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.