Mercurial > public > sg101
diff gpp/mailer/__init__.py @ 316:767cedc7d12a
Fixing #144; integrate with new Django logging support. Also added unit tests for Donations app.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 30 Jan 2011 20:02:32 +0000 |
parents | aef00df91165 |
children |
line wrap: on
line diff
--- a/gpp/mailer/__init__.py Sat Jan 29 20:39:55 2011 +0000 +++ b/gpp/mailer/__init__.py Sun Jan 30 20:02:32 2011 +0000 @@ -1,6 +1,7 @@ from socket import error as socket_error import smtplib import time +import logging import django.core.mail @@ -27,7 +28,6 @@ sent, errors = 0, 0 - import logging logging.debug("Sending queued mail...") start_time = time.time() @@ -35,17 +35,17 @@ for msg in msgs: try: django.core.mail.send_mail( - msg.subject, - msg.body, - msg.from_address, + msg.subject, + msg.body, + msg.from_address, [msg.to_address], fail_silently=False) except (socket_error, smtplib.SMTPException), e: errors += 1 - logging.error("Error sending queued mail: %s" % e) + logging.error("Error sending queued mail: %s", e) else: - sent += 1 - msg.delete() + sent += 1 + msg.delete() end_time = time.time() logging.debug("Sent queued mail: %d successful, %d error(s); elapsed time: %.2f" % (