summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-12-12 17:51:51 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-12-12 17:51:51 +0000
commitac8da7b36f353ffc225ee27b0aeb96f8912b9362 (patch)
tree70d777c3417f621c4e33044f1e8bd970742d6704 /django
parentf761802b228826f31af48f520a2f4b70725801f6 (diff)
FIxed #10130: you may now delete attributes on `settings`. Thanks, jcassee.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11824 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 434b6b76c9..823cda4587 100644
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -277,6 +277,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.