Always show "all" email settings if user has config perm

also tweak view config, per newer convention
This commit is contained in:
Lance Edgar 2022-08-06 22:57:10 -05:00
parent d74025318e
commit 1152fba067

View file

@ -100,7 +100,7 @@ class EmailSettingView(MasterView):
def get_data(self, session=None): def get_data(self, session=None):
data = [] data = []
if self.has_perm('configure') and self.email_handler.use_entry_points(): if self.has_perm('configure'):
emails = self.email_handler.get_all_emails() emails = self.email_handler.get_all_emails()
else: else:
emails = self.email_handler.get_available_emails() emails = self.email_handler.get_available_emails()
@ -525,7 +525,18 @@ class EmailAttemptView(MasterView):
f.set_enum('status_code', self.enum.EMAIL_ATTEMPT) f.set_enum('status_code', self.enum.EMAIL_ATTEMPT)
def includeme(config): def defaults(config, **kwargs):
base = globals()
EmailSettingView = kwargs.get('EmailSettingView', base['EmailSettingView'])
EmailSettingView.defaults(config) EmailSettingView.defaults(config)
EmailPreview = kwargs.get('EmailPreview', base['EmailPreview'])
EmailPreview.defaults(config) EmailPreview.defaults(config)
EmailAttemptView = kwargs.get('EmailAttemptView', base['EmailAttemptView'])
EmailAttemptView.defaults(config) EmailAttemptView.defaults(config)
def includeme(config):
defaults(config)