summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-26 18:37:04 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-26 19:21:02 +0100
commitfec5330c7937efe30294d060a57af6400ce073a9 (patch)
tree47794cb2a920ad7d4ce738a7323888b9439c3926
parent8925aaf61304c22f5ba86dad5d6b15c277b33cfb (diff)
Made unset_installed_apps reset the app registry state.
Previously the _apps/models_loaded flags could remain set to False if set_installed_apps exited with an exception, which is going to happen as soon as we add tests for invalid values of INSTALLED_APPS.
-rw-r--r--django/apps/registry.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/apps/registry.py b/django/apps/registry.py
index e39fb43fa4..737fc960b8 100644
--- a/django/apps/registry.py
+++ b/django/apps/registry.py
@@ -346,7 +346,7 @@ class Apps(object):
imports safely (eg. that could lead to registering listeners twice),
models are registered when they're imported and never removed.
"""
- self.stored_app_configs.append(self.app_configs)
+ self.stored_app_configs.append((self.app_configs, self._apps_loaded, self._models_loaded))
self.app_configs = OrderedDict()
self.get_models.cache_clear()
self._apps_loaded = False
@@ -358,7 +358,7 @@ class Apps(object):
"""
Cancels a previous call to set_installed_apps().
"""
- self.app_configs = self.stored_app_configs.pop()
+ self.app_configs, self._apps_loaded, self._models_loaded = self.stored_app_configs.pop()
self.get_models.cache_clear()
### DEPRECATED METHODS GO BELOW THIS LINE ###