From 9cda5b6ce844f85c79273c8269960fcb3e394b01 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 20 Sep 2020 18:55:46 -0500 Subject: [PATCH] Include POS integration web templates, as configured --- theo/web/app.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/theo/web/app.py b/theo/web/app.py index f1f73fb..564b89e 100644 --- a/theo/web/app.py +++ b/theo/web/app.py @@ -33,15 +33,22 @@ def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ - # prefer Theo templates over Tailbone - settings.setdefault('mako.directories', ['theo.web:templates', - 'tailbone:templates',]) + # establish rattail config + rattail_config = app.make_rattail_config(settings) + + # which template directories we want depends on integration + directories = ['theo.web:templates'] + if integrate_corepos(rattail_config): + directories.append('tailbone_corepos:templates') + if integrate_catapult(rattail_config): + directories.append('tailbone_onager:templates') + directories.append('tailbone:templates') + settings.setdefault('mako.directories', directories) # for graceful handling of postgres restart settings.setdefault('retry.attempts', 2) - # make config objects - rattail_config = app.make_rattail_config(settings) + # establish pyramid config pyramid_config = app.make_pyramid_config(settings) # maybe configure integration db connections