mirror of
https://github.com/jazzband/django-dbtemplates.git
synced 2026-05-26 16:04:07 +00:00
Fix #27.
dbtemplates tries to find template from database which is associated with current site, and if that fails then template from database which is not associated with any site.
This commit is contained in:
parent
f503013b0f
commit
29f08281d7
1 changed files with 2 additions and 1 deletions
|
|
@ -62,7 +62,8 @@ class Loader(BaseLoader):
|
|||
return set_and_return(cache_key, template.content, display_name)
|
||||
except (Template.MultipleObjectsReturned, Template.DoesNotExist):
|
||||
try:
|
||||
template = Template.objects.get(name__exact=template_name)
|
||||
template = Template.objects.get(name__exact=template_name,
|
||||
sites__in=[])
|
||||
return set_and_return(cache_key, template.content, display_name)
|
||||
except Template.DoesNotExist:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Reference in a new issue