use 'wagtail_serve' as the url name rather than 'wagtail'

pull/538/head
Matt Westcott 2014-08-12 15:36:11 +01:00
rodzic fe28f5649e
commit 07a48abf58
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -489,7 +489,7 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index
"""Return the full URL (including protocol / domain) to this page, or None if it is not routable"""
for (id, root_path, root_url) in Site.get_site_root_paths():
if self.url_path.startswith(root_path):
return root_url + reverse('wagtail', args=(self.url_path[len(root_path):],))
return root_url + reverse('wagtail_serve', args=(self.url_path[len(root_path):],))
@property
def url(self):
@ -504,7 +504,7 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index
root_paths = Site.get_site_root_paths()
for (id, root_path, root_url) in Site.get_site_root_paths():
if self.url_path.startswith(root_path):
return ('' if len(root_paths) == 1 else root_url) + reverse('wagtail', args=(self.url_path[len(root_path):],))
return ('' if len(root_paths) == 1 else root_url) + reverse('wagtail_serve', args=(self.url_path[len(root_path):],))
def relative_url(self, current_site):
"""
@ -514,7 +514,7 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index
"""
for (id, root_path, root_url) in Site.get_site_root_paths():
if self.url_path.startswith(root_path):
return ('' if current_site.id == id else root_url) + reverse('wagtail', args=(self.url_path[len(root_path):],))
return ('' if current_site.id == id else root_url) + reverse('wagtail_serve', args=(self.url_path[len(root_path):],))
@classmethod
def search(cls, query_string, show_unpublished=False, search_title_only=False, extra_filters={}, prefetch_related=[], path=None):

Wyświetl plik

@ -10,5 +10,5 @@ urlpatterns = [
# a '/'. If a trailing slash is not present, we leave CommonMiddleware to
# handle it as usual (i.e. redirect it to the trailing slash version if
# settings.APPEND_SLASH is True)
url(r'^((?:[\w\-]+/)*)$', views.serve, name="wagtail")
url(r'^((?:[\w\-]+/)*)$', views.serve, name='wagtail_serve')
]