From 9618ac009427c449612416bb4d8383f53186534c Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 19 Jul 2024 17:50:38 +0530 Subject: [PATCH] Cleanup and use correct page for EN --- publichealth/home/templatetags/navigation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/publichealth/home/templatetags/navigation.py b/publichealth/home/templatetags/navigation.py index 9b5afe5..21d1d8a 100644 --- a/publichealth/home/templatetags/navigation.py +++ b/publichealth/home/templatetags/navigation.py @@ -77,14 +77,12 @@ def menuitems_children(parent, context=None): menuitems_children = parent.get_children().live().in_menu().specific() items_to_remove = [] for menuitem in menuitems_children: - print('type => %s' % type(menuitem)) try: if 'devenez' in menuitem.title.lower() and remove_devenez: items_to_remove.append(menuitem) elif 'mitglied werden' in menuitem.title.lower() and remove_mitglied: items_to_remove.append(menuitem) except AttributeError as ae: - print("Menuitem %s has an issue :: %s" % (menuitem.title, str(ae))) pass for item in items_to_remove: menuitems_children = menuitems_children & Page.objects.not_page(item) @@ -94,7 +92,10 @@ def menuitems_children(parent, context=None): if site.hostname in ['sphc.ch', 'public-health.ch']: print("site is %s, add terms and conditions to footer" % site.hostname) # custom page here is the terms and conditions page for public-health.ch and sphc.ch (common) - custom_page_id = 994 + if request.__dict__.get('LANGUAGE_CODE', 'de').lower() == 'en': + custom_page_id = 1020 + else: + custom_page_id = 994 custom_page = Page.objects.get(id=custom_page_id) menuitems_children = list(menuitems_children) menuitems_children.append(custom_page)