diff --git a/wagtail/wagtailcore/templatetags/wagtailcore_tags.py b/wagtail/wagtailcore/templatetags/wagtailcore_tags.py index f0289af6b6..5eee06f282 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)