From 1d37fb6f4bce932dfe6ff3e1c54545887023cfc0 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Wed, 21 Apr 2010 09:42:34 +0100 Subject: [PATCH] Try sending mails and fail gracefully if unsuccessful --- hr/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hr/views.py b/hr/views.py index 9383a6c..805b973 100644 --- a/hr/views.py +++ b/hr/views.py @@ -156,7 +156,10 @@ def update_application(request, applicationid): subject = render_to_string('hr/emails/%s_subject.txt' % message_type, { 'app': app }) subject = ''.join(subject.splitlines()) message = render_to_string('hr/emails/%s.txt' % message_type, { 'app': app }) - #send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [application.user.email]) + try: + send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [application.user.email]) + except: + pass if len(application.user.redditaccount_set.all()) > 0: from reddit.api import Inbox