diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-12-15 11:29:24 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-12-17 10:17:45 +0100 |
| commit | b3e182faba4a45ae617509bc5e15fd0b8e096e9a (patch) | |
| tree | 8c79d839af7a46d9574831bc0f81e1a959723cc3 | |
| parent | 30bdad1c47bdd04226e849ca62f703edadf23c0f (diff) | |
Fixed incorrect decrementation of nesting_level.
Thanks Florian for catching this mistake.
| -rw-r--r-- | django/apps/cache.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/django/apps/cache.py b/django/apps/cache.py index 4d1c75dd5b..e91804d6ac 100644 --- a/django/apps/cache.py +++ b/django/apps/cache.py @@ -114,7 +114,6 @@ class BaseAppCache(object): try: models_module = import_module('%s.%s' % (app_name, MODELS_MODULE_NAME)) except ImportError: - self.nesting_level -= 1 # If the app doesn't have a models module, we can just swallow the # ImportError and return no models for this app. if not module_has_submodule(app_module, MODELS_MODULE_NAME): @@ -132,8 +131,8 @@ class BaseAppCache(object): return else: raise - - self.nesting_level -= 1 + finally: + self.nesting_level -= 1 app_config = AppConfig( name=app_name, app_module=app_module, models_module=models_module) |
