Skip to content

Commit

Permalink
Only show bookmark icon on pages (#865)
Browse files Browse the repository at this point in the history
  • Loading branch information
CamLamb authored Jan 14, 2025
1 parent 5b2e8f1 commit a5bae1c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/templatetags/sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit a5bae1c

Please sign in to comment.