0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

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

This commit is contained in:
Karl Hobley 2014-05-02 13:10:55 +01:00
parent 913f21d09b
commit d6cce69a39

View File

@ -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):