From e96c0a15280bc5545f383be89056f27cb8df2199 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Tue, 12 Jun 2018 22:52:31 +0200 Subject: [PATCH] Site root query --- publichealth/home/templatetags/information.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/publichealth/home/templatetags/information.py b/publichealth/home/templatetags/information.py index 2a6d221..54151a9 100644 --- a/publichealth/home/templatetags/information.py +++ b/publichealth/home/templatetags/information.py @@ -8,13 +8,13 @@ register = template.Library() def get_contacts(site_root): if not site_root: return {} - site_id = site_root.id - top_contact = Contact.objects.filter(home_site=site_id) + site = site_root.get_site() + top_contact = Contact.objects.filter(home_site=site) if top_contact.exists(): top_contact = top_contact.last() else: top_contact = Contact.objects.last() - social_contacts = SocialContact.objects.filter(home_site=site_id) + social_contacts = SocialContact.objects.filter(home_site=site) if social_contacts.exists(): social_contacts = social_contacts.all() else: