Commit 527d0f86 authored by Michal Čihař's avatar Michal Čihař

Gracefully handle situation when user can no longer get notification

Eg. he was removed for the ACL project.

Fixes #1078
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent dc33a0db
......@@ -57,7 +57,9 @@ def send_mails(mails):
"""Sends multiple mails in single connection."""
try:
connection = get_connection()
connection.send_messages(mails)
connection.send_messages(
[mail for mail in mails if mail is not None]
)
except SMTPException as error:
LOGGER.error('Failed to send email: %s', error)
report_error(error, sys.exc_info())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment