1. joskid
  2. cciw-website

Commits

Luke Plant  committed dca8ef3

Made use of exception_notify_admins utility in handle_mailing_lists command

  • Participants
  • Parent commits 8a5d1b7
  • Branches bookings

Comments (0)

Files changed (1)

File cciw/cciwmain/management/commands/handle_mailing_lists.py

View file
  • Ignore whitespace
                 from cciw.mail.lists import handle_all_mail
                 handle_all_mail()
             except:
-                from django.core.mail import mail_admins
-                import traceback
-                import sys
-                subject = 'Sending mail error'
-                exc_info = sys.exc_info()
-                message = '\n'.join(traceback.format_exception(*exc_info))
-                mail_admins(subject, message, fail_silently=True)
+                from cciw.cciwmain.common import exception_notify_admins
+                exception_notify_admins('Sending mail error')
+
         finally:
             # Delete the lock
             l.close()