From 8fe3cdbbc3f860f79620eb330cf1cecc82d08981 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 5 Jan 2024 15:46:38 +0000 Subject: [PATCH] Replace custom `pagefullurl` tag with built-in --- website/common/templates/common/shareon.html | 4 ++-- website/common/templatetags/util_tags.py | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/website/common/templates/common/shareon.html b/website/common/templates/common/shareon.html index 47651b8..a8e6cb0 100644 --- a/website/common/templates/common/shareon.html +++ b/website/common/templates/common/shareon.html @@ -1,8 +1,8 @@ -{% load util_tags %} +{% load wagtailcore_tags %}

Share this page

-
+
diff --git a/website/common/templatetags/util_tags.py b/website/common/templatetags/util_tags.py index bc7e1cd..f00edbe 100644 --- a/website/common/templatetags/util_tags.py +++ b/website/common/templatetags/util_tags.py @@ -1,6 +1,5 @@ from django.template import Library from django.utils.encoding import force_str -from wagtail.models import Page from wagtail.rich_text import RichText from website.common import utils @@ -13,11 +12,6 @@ def do_range(stop: int) -> range: return range(stop) -@register.simple_tag(takes_context=True) -def pagefullurl(context: dict, page: Page) -> str: - return page.get_full_url(context["request"]) - - @register.filter() def extract_text(html: str | RichText) -> str: return utils.extract_text(force_str(html))