From a5bae1cb26fda7cf93348683545935fea230d681 Mon Sep 17 00:00:00 2001 From: Cameron Lamb Date: Tue, 14 Jan 2025 17:04:24 +0000 Subject: [PATCH] Only show bookmark icon on pages (#865) --- src/core/templatetags/sidebar.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/templatetags/sidebar.py b/src/core/templatetags/sidebar.py index 7ee64e831..55d70f036 100644 --- a/src/core/templatetags/sidebar.py +++ b/src/core/templatetags/sidebar.py @@ -5,6 +5,7 @@ from django.urls import reverse from django.utils.safestring import SafeString from waffle import flag_is_active +from wagtail.models import Page from core.models.models import SiteAlertBanner from home.models import HomePage, QuickLink @@ -143,12 +144,15 @@ class Bookmark(SidebarPart): def is_visible(self): request = self.context["request"] + if not flag_is_active(request, "new_sidebar"): return False + page = self.context.get("self") if isinstance(page, HomePage): return False - return True + + return isinstance(page, Page) def get_part_context(self): user = self.context.get("user")