misc: update template loader for django 2.2 compatibility

This commit is contained in:
Frédéric Péters 2020-04-01 14:58:08 +02:00
parent 48d909cb43
commit bf5c677404
1 changed files with 4 additions and 7 deletions

View File

@ -23,10 +23,9 @@ from .qommon.publisher import get_cfg, get_publisher
class TemplateLoader(django.template.loaders.filesystem.Loader):
def get_template_sources(self, template_name, template_dirs=None):
if not template_dirs:
template_dirs = []
def get_dirs(self):
template_dirs = []
if get_publisher():
# theme set by hobo
theme = get_publisher().get_site_option('theme', 'variables')
@ -51,6 +50,4 @@ class TemplateLoader(django.template.loaders.filesystem.Loader):
template_dirs.append(theme_directory)
template_dirs = tuple(template_dirs)
return super(TemplateLoader, self).get_template_sources(template_name, template_dirs)
return template_dirs