From 5b05f9426f2d6950763ce6b346b2e6eef57dccc9 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 25 Sep 2020 16:04:32 -0500 Subject: [PATCH] Allow alternate engine to act as 'default' when multiple are available --- tailbone/views/master.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tailbone/views/master.py b/tailbone/views/master.py index cae51b89..729948d2 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -2471,12 +2471,22 @@ class MasterView(View): return ['/mobile/master/{}.mako'.format(template)] return ['/master/{}.mako'.format(template)] + def get_default_engine_dbkey(self): + """ + Returns the "default" engine dbkey. + """ + return self.rattail_config.get( + 'tailbone', + 'engines.{}.pretend_default'.format(self.engine_type_key), + default='default') + def get_current_engine_dbkey(self): """ Returns the "current" engine's dbkey, for the current user. """ + default = self.get_default_engine_dbkey() return self.request.session.get('tailbone.engines.{}.current'.format(self.engine_type_key), - 'default') + default) def template_kwargs(self, **kwargs): """