Skip to content

Commit

Permalink
Invalidated get_models cache in a few more places.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Dec 24, 2013
1 parent 82a35e2 commit e9e522a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions django/apps/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,14 @@ def set_available_apps(self, available):
(label, app_config)
for label, app_config in self.app_configs.items()
if app_config.name in available)
self.get_models.cache_clear()

def unset_available_apps(self):
"""
Cancels a previous call to set_available_apps().
"""
self.app_configs = self.stored_app_configs.pop()
self.get_models.cache_clear()

def set_installed_apps(self, installed):
"""
Expand All @@ -340,6 +342,7 @@ def set_installed_apps(self, installed):
"""
self.stored_app_configs.append(self.app_configs)
self.app_configs = OrderedDict()
self.get_models.cache_clear()
self._apps_loaded = False
self.populate_apps(installed)
self._models_loaded = False
Expand All @@ -350,6 +353,7 @@ def unset_installed_apps(self):
Cancels a previous call to set_installed_apps().
"""
self.app_configs = self.stored_app_configs.pop()
self.get_models.cache_clear()

### DEPRECATED METHODS GO BELOW THIS LINE ###

Expand Down

0 comments on commit e9e522a

Please sign in to comment.