Ticket #10130: 10130-r9791.diff

File 10130-r9791.diff, 807 bytes (added by Joost Cassee, 16 years ago)
  • django/conf/__init__.py

     
    4141                self._import_settings()
    4242            setattr(self._target, name, value)
    4343
     44    def __delattr__(self, name):
     45        if name == '_target':
     46            # Delete directly from self.__dict__, because otherwise we'd call
     47            # __delattr__(), which would be an infinite loop.
     48            del self.__dict__['_target']
     49        else:
     50            if self._target is None:
     51                self._import_settings()
     52            delattr(self._target, name)
     53
    4454    def _import_settings(self):
    4555        """
    4656        Load the settings module pointed to by the environment variable. This
Back to Top