misc: update template loader for django 2.2 compatibility
This commit is contained in:
parent
48d909cb43
commit
bf5c677404
11
wcs/utils.py
11
wcs/utils.py
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue