Allow alternate engine to act as 'default' when multiple are available

This commit is contained in:
Lance Edgar 2020-09-25 16:04:32 -05:00
parent 9dc9bd162f
commit 5b05f9426f

View file

@ -2471,12 +2471,22 @@ class MasterView(View):
return ['/mobile/master/{}.mako'.format(template)] return ['/mobile/master/{}.mako'.format(template)]
return ['/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): def get_current_engine_dbkey(self):
""" """
Returns the "current" engine's dbkey, for the current user. 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), return self.request.session.get('tailbone.engines.{}.current'.format(self.engine_type_key),
'default') default)
def template_kwargs(self, **kwargs): def template_kwargs(self, **kwargs):
""" """