fix: show non-standard config values for app info configure email

this page is currently showing some basic email sender/recips etc. but
the config keys traditionally used by rattail are different than
wuttjamaican..so for now we must "translate"
This commit is contained in:
Lance Edgar 2024-08-26 15:24:40 -05:00
parent 3a9bf69aa7
commit d67eb2f1cc

View file

@ -81,15 +81,56 @@ class AppInfoView(WuttaAppInfoView):
""" """ """ """
simple_settings = super().configure_get_simple_settings() simple_settings = super().configure_get_simple_settings()
# TODO: the update home page redirect setting is off by
# default for wuttaweb, but on for tailbone
for setting in simple_settings: for setting in simple_settings:
# TODO: the update home page redirect setting is off by
# default for wuttaweb, but on for tailbone
if setting['name'] == 'wuttaweb.home_redirect_to_login': if setting['name'] == 'wuttaweb.home_redirect_to_login':
value = self.config.get_bool('wuttaweb.home_redirect_to_login') value = self.config.get_bool('wuttaweb.home_redirect_to_login')
if value is None: if value is None:
value = self.config.get_bool('tailbone.login_is_home', default=True) value = self.config.get_bool('tailbone.login_is_home', default=True)
setting['default'] = value setting['value'] = value
break
# TODO: sending email is off by default for wuttjamaican,
# but on for rattail
elif setting['name'] == 'rattail.mail.send_emails':
value = self.config.get_bool('rattail.mail.send_emails', default=True)
setting['value'] = value
# TODO: email defaults have different config keys in rattail
elif setting['name'] == 'rattail.email.default.sender':
value = self.config.get('rattail.email.default.sender')
if value is None:
value = self.config.get('rattail.mail.default.from')
setting['value'] = value
# TODO: email defaults have different config keys in rattail
elif setting['name'] == 'rattail.email.default.subject':
value = self.config.get('rattail.email.default.subject')
if value is None:
value = self.config.get('rattail.mail.default.subject')
setting['value'] = value
# TODO: email defaults have different config keys in rattail
elif setting['name'] == 'rattail.email.default.to':
value = self.config.get('rattail.email.default.to')
if value is None:
value = self.config.get('rattail.mail.default.to')
setting['value'] = value
# TODO: email defaults have different config keys in rattail
elif setting['name'] == 'rattail.email.default.cc':
value = self.config.get('rattail.email.default.cc')
if value is None:
value = self.config.get('rattail.mail.default.cc')
setting['value'] = value
# TODO: email defaults have different config keys in rattail
elif setting['name'] == 'rattail.email.default.bcc':
value = self.config.get('rattail.email.default.bcc')
if value is None:
value = self.config.get('rattail.mail.default.bcc')
setting['value'] = value
# nb. these are no longer used (deprecated), but we keep # nb. these are no longer used (deprecated), but we keep
# them defined here so the tool auto-deletes them # them defined here so the tool auto-deletes them