Site root query
This commit is contained in:
parent
c9da4db6ac
commit
e96c0a1528
1 changed files with 3 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue