From 51bf76ba7048532770f347a1b2430dfc5e1abc1e Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Sat, 8 Aug 2015 15:50:39 +0200 Subject: [PATCH] Don't call Site.get_root_paths() twice in Page.url property --- wagtail/wagtailcore/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index 92e6f3512..d104e2bb0 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -589,7 +589,7 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed Return None if the page is not routable. """ root_paths = Site.get_site_root_paths() - for (id, root_path, root_url) in Site.get_site_root_paths(): + for (id, root_path, root_url) in root_paths: if self.url_path.startswith(root_path): return ('' if len(root_paths) == 1 else root_url) + reverse('wagtail_serve', args=(self.url_path[len(root_path):],))