Tweak email config view a bit, for clarity

This commit is contained in:
Lance Edgar 2016-11-15 19:36:08 -06:00
parent c275071499
commit a5184e416a

View file

@ -150,7 +150,7 @@ class ProfilesView(MasterView):
creating=self.creating,
editing=self.editing,
action_url=self.request.current_route_url(_query=None),
cancel_url=self.get_index_url() if self.creating else self.get_action_url('view', email))
cancel_url=self.get_action_url('view', email))
form.readonly = self.viewing
return form
@ -159,14 +159,15 @@ class ProfilesView(MasterView):
fs.sync()
key = fs.key._value
api.save_setting(Session(), 'rattail.mail.{}.prefix'.format(key), fs.prefix._value)
api.save_setting(Session(), 'rattail.mail.{}.subject'.format(key), fs.subject._value)
api.save_setting(Session(), 'rattail.mail.{}.from'.format(key), fs.sender._value)
api.save_setting(Session(), 'rattail.mail.{}.replyto'.format(key), fs.replyto._value)
api.save_setting(Session(), 'rattail.mail.{}.to'.format(key), (fs.to._value or '').replace('\n', ', '))
api.save_setting(Session(), 'rattail.mail.{}.cc'.format(key), (fs.cc._value or '').replace('\n', ', '))
api.save_setting(Session(), 'rattail.mail.{}.bcc'.format(key), (fs.bcc._value or '').replace('\n', ', '))
api.save_setting(Session(), 'rattail.mail.{}.enabled'.format(key), unicode(fs.enabled._value).lower())
session = Session()
api.save_setting(session, 'rattail.mail.{}.prefix'.format(key), fs.prefix._value)
api.save_setting(session, 'rattail.mail.{}.subject'.format(key), fs.subject._value)
api.save_setting(session, 'rattail.mail.{}.from'.format(key), fs.sender._value)
api.save_setting(session, 'rattail.mail.{}.replyto'.format(key), fs.replyto._value)
api.save_setting(session, 'rattail.mail.{}.to'.format(key), (fs.to._value or '').replace('\n', ', '))
api.save_setting(session, 'rattail.mail.{}.cc'.format(key), (fs.cc._value or '').replace('\n', ', '))
api.save_setting(session, 'rattail.mail.{}.bcc'.format(key), (fs.bcc._value or '').replace('\n', ', '))
api.save_setting(session, 'rattail.mail.{}.enabled'.format(key), unicode(fs.enabled._value).lower())
def template_kwargs_view(self, **kwargs):
key = self.request.matchdict['key']