Clear 'wagtail_site_root_paths' when a site root page is saved fixes #7 fixes #157

pull/227/head
Karl Hobley 2014-05-02 13:10:55 +01:00
rodzic 913f21d09b
commit d6cce69a39
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -302,6 +302,11 @@ class Page(MP_Node, ClusterableModel, Indexed):
if update_descendant_url_paths:
self._update_descendant_url_paths(old_url_path, new_url_path)
# Check if this is a root page of any sites and clear the 'wagtail_site_root_paths' key if so
if Site.objects.filter(root_page=self).exists():
cache.delete('wagtail_site_root_paths')
return result
def _update_descendant_url_paths(self, old_url_path, new_url_path):