From 248b95d3f5769bd3d131c9c523ba8a349c957348 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Thu, 17 Aug 2017 15:15:20 +0100 Subject: [PATCH] Remove check for relative_url without a request kwarg from the pageurl tag --- .../wagtailcore/templatetags/wagtailcore_tags.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/wagtail/wagtailcore/templatetags/wagtailcore_tags.py b/wagtail/wagtailcore/templatetags/wagtailcore_tags.py index f0289af6b..5eee06f28 100644 --- a/wagtail/wagtailcore/templatetags/wagtailcore_tags.py +++ b/wagtail/wagtailcore/templatetags/wagtailcore_tags.py @@ -8,7 +8,6 @@ from django.utils.safestring import mark_safe from wagtail import __version__ from wagtail.wagtailcore.models import Page from wagtail.wagtailcore.rich_text import RichText, expand_db_html -from wagtail.wagtailcore.utils import accepts_kwarg register = template.Library() @@ -25,16 +24,11 @@ def pageurl(context, page): # request.site not available in the current context; fall back on page.url return page.url - # RemovedInWagtail113Warning - this accepts_kwarg test can be removed when we drop support - # for relative_url methods which omit the `request` kwarg - if accepts_kwarg(page.relative_url, 'request'): - # Pass page.relative_url the request object, which may contain a cached copy of - # Site.get_site_root_paths() - # This avoids page.relative_url having to make a database/cache fetch for this list - # each time it's called. - return page.relative_url(current_site, request=context.get('request')) - else: - return page.relative_url(current_site) + # Pass page.relative_url the request object, which may contain a cached copy of + # Site.get_site_root_paths() + # This avoids page.relative_url having to make a database/cache fetch for this list + # each time it's called. + return page.relative_url(current_site, request=context.get('request')) @register.simple_tag(takes_context=True)