Avoided leaking state on exceptions in populate_models().
This commit is contained in:
parent
e5c89c62f2
commit
d6dc88cbc1
|
@ -125,10 +125,11 @@ class Apps(object):
|
||||||
self._postponed.append(app_config)
|
self._postponed.append(app_config)
|
||||||
|
|
||||||
if outermost:
|
if outermost:
|
||||||
|
try:
|
||||||
for app_config in self._postponed:
|
for app_config in self._postponed:
|
||||||
all_models = self.all_models[app_config.label]
|
all_models = self.all_models[app_config.label]
|
||||||
app_config.import_models(all_models)
|
app_config.import_models(all_models)
|
||||||
|
finally:
|
||||||
del self._postponed
|
del self._postponed
|
||||||
|
|
||||||
self.clear_cache()
|
self.clear_cache()
|
||||||
|
|
Loading…
Reference in New Issue