Improve on bare excepts

- And simplify email sending recipient gathering
This commit is contained in:
Scot Hacker 2018-02-10 23:44:26 -08:00
parent 8cba92b571
commit 4d0801313c
2 changed files with 8 additions and 11 deletions

View file

@ -39,5 +39,5 @@ def send_notify_mail(request, new_task):
send_mail(
email_subject, email_body, new_task.created_by.email,
[new_task.assigned_to.email], fail_silently=False)
except:
except ConnectionRefusedError:
messages.error(request, "Task saved but mail not sent. Contact your administrator.")