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):
|
def get_contacts(site_root):
|
||||||
if not site_root: return {}
|
if not site_root: return {}
|
||||||
site_id = site_root.id
|
site = site_root.get_site()
|
||||||
top_contact = Contact.objects.filter(home_site=site_id)
|
top_contact = Contact.objects.filter(home_site=site)
|
||||||
if top_contact.exists():
|
if top_contact.exists():
|
||||||
top_contact = top_contact.last()
|
top_contact = top_contact.last()
|
||||||
else:
|
else:
|
||||||
top_contact = Contact.objects.last()
|
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():
|
if social_contacts.exists():
|
||||||
social_contacts = social_contacts.all()
|
social_contacts = social_contacts.all()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue