Skip to content

Commit 7dd6ed7

Browse files
authored
Merge pull request #66 from alexhanna/master
adding check for additional template dir
2 parents 5c0fdda + 5238ca0 commit 7dd6ed7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: mpeds_coder.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ def construct_mapping(loader, node):
8383

8484
# customize template path
8585
# copy-pasta from https://stackoverflow.com/questions/13598363/how-to-dynamically-select-template-directory-to-be-used-in-flask
86-
template_loader = jinja2.ChoiceLoader([
87-
jinja2.FileSystemLoader([app.config['ADDITIONAL_TEMPLATE_DIR']]),
88-
app.jinja_loader])
89-
app.jinja_loader = template_loader
86+
if 'ADDITIONAL_TEMPLATE_DIR' in app.config and app.config.get('ADDITIONAL_TEMPLATE_DIR'):
87+
template_loader = jinja2.ChoiceLoader([
88+
jinja2.FileSystemLoader([app.config['ADDITIONAL_TEMPLATE_DIR']]),
89+
app.jinja_loader])
90+
app.jinja_loader = template_loader
9091

9192

9293
## login stuff

0 commit comments

Comments
 (0)