Invalidated get_models cache in a few more places.

This commit is contained in:
Aymeric Augustin 2013-12-24 11:09:24 +01:00
parent 82a35e24d4
commit e9e522a8e7
1 changed files with 4 additions and 0 deletions

View File

@ -314,12 +314,14 @@ class AppCache(object):
(label, app_config) (label, app_config)
for label, app_config in self.app_configs.items() for label, app_config in self.app_configs.items()
if app_config.name in available) if app_config.name in available)
self.get_models.cache_clear()
def unset_available_apps(self): def unset_available_apps(self):
""" """
Cancels a previous call to set_available_apps(). Cancels a previous call to set_available_apps().
""" """
self.app_configs = self.stored_app_configs.pop() self.app_configs = self.stored_app_configs.pop()
self.get_models.cache_clear()
def set_installed_apps(self, installed): def set_installed_apps(self, installed):
""" """
@ -340,6 +342,7 @@ class AppCache(object):
""" """
self.stored_app_configs.append(self.app_configs) self.stored_app_configs.append(self.app_configs)
self.app_configs = OrderedDict() self.app_configs = OrderedDict()
self.get_models.cache_clear()
self._apps_loaded = False self._apps_loaded = False
self.populate_apps(installed) self.populate_apps(installed)
self._models_loaded = False self._models_loaded = False
@ -350,6 +353,7 @@ class AppCache(object):
Cancels a previous call to set_installed_apps(). Cancels a previous call to set_installed_apps().
""" """
self.app_configs = self.stored_app_configs.pop() self.app_configs = self.stored_app_configs.pop()
self.get_models.cache_clear()
### DEPRECATED METHODS GO BELOW THIS LINE ### ### DEPRECATED METHODS GO BELOW THIS LINE ###