From 1a111be0d59075736d7396114af6a168f0584c06 Mon Sep 17 00:00:00 2001 From: nathaniel smith Date: Sat, 21 Jan 2017 00:34:17 -0800 Subject: [PATCH] signal email sending success --- ttadmin/common/mailing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ttadmin/common/mailing.py b/ttadmin/common/mailing.py index 677218c..e76a218 100644 --- a/ttadmin/common/mailing.py +++ b/ttadmin/common/mailing.py @@ -21,8 +21,12 @@ def send_email(to, body, subject='a message from tilde.town', frum=FROM,): } ) - if response.status_code != 200: + success = response.status_code == 200 + + if not success: logger.error('{}: failed to send email "{}" to {}'.format( response.status_code, subject, to)) + + return success