Fixed incorrect decrementation of nesting_level.

Thanks Florian for catching this mistake.
This commit is contained in:
Aymeric Augustin 2013-12-15 11:29:24 +01:00
parent 30bdad1c47
commit b3e182faba
1 changed files with 2 additions and 3 deletions

View File

@ -114,7 +114,6 @@ class BaseAppCache(object):
try: try:
models_module = import_module('%s.%s' % (app_name, MODELS_MODULE_NAME)) models_module = import_module('%s.%s' % (app_name, MODELS_MODULE_NAME))
except ImportError: except ImportError:
self.nesting_level -= 1
# If the app doesn't have a models module, we can just swallow the # If the app doesn't have a models module, we can just swallow the
# ImportError and return no models for this app. # ImportError and return no models for this app.
if not module_has_submodule(app_module, MODELS_MODULE_NAME): if not module_has_submodule(app_module, MODELS_MODULE_NAME):
@ -132,8 +131,8 @@ class BaseAppCache(object):
return return
else: else:
raise raise
finally:
self.nesting_level -= 1 self.nesting_level -= 1
app_config = AppConfig( app_config = AppConfig(
name=app_name, app_module=app_module, models_module=models_module) name=app_name, app_module=app_module, models_module=models_module)