Skip to content

Commit

Permalink
fix bug failing to pass through id_only
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyclark committed Jul 22, 2012
1 parent 417cd44 commit 6eba4a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions multihost/sites.py
Expand Up @@ -82,21 +82,21 @@ def by_host(host=None, id_only=False, recursion=False):
# try to get the Site out of Django's cache
site = cache.get(key)
if not site:
site = lookup(site, host, recursion)
site = lookup(site, host, recursion, id_only)
# if we finally have the Site, save it in the cache to prevent
# the intensive lookup again!
if site:
cache.set(key, site)
else:
site = lookup(site, host, recursion)
site = lookup(site, host, recursion, id_only)

# was it an ID-only request? if so return the site ID only!
if site and id_only:
site = site.id

return site

def lookup(site, host, recursion):
def lookup(site, host, recursion, id_only):
try:
site = Site.objects.get(domain=host)
except Site.DoesNotExist:
Expand Down

0 comments on commit 6eba4a3

Please sign in to comment.