From 35d1c24bc73a90f01782dfdc4a100d4ed5f7536f Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 10 Dec 2016 14:54:30 -0600 Subject: [PATCH] Tweak flash message when sending email preview, in case it's disabled --- tailbone/views/email.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tailbone/views/email.py b/tailbone/views/email.py index ab667ec0..a028f316 100644 --- a/tailbone/views/email.py +++ b/tailbone/views/email.py @@ -226,9 +226,10 @@ class EmailPreview(View): del msg['Bcc'] msg['To'] = recipient - mail.deliver_message(self.rattail_config, msg) + sent = mail.deliver_message(self.rattail_config, key, msg) - self.request.session.flash("Preview for '{0}' was emailed to {1}".format(key, recipient)) + self.request.session.flash("Preview for '{}' was {}emailed to {}".format( + key, '' if sent else '(NOT) ', recipient)) def preview_template(self, key, type_): email = mail.get_email(self.rattail_config, key)