diff gpp/core/functions.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 e3958aacd8dd
children 20af29454e83
line wrap: on
line diff
--- a/gpp/core/functions.py	Sat Jan 29 20:39:55 2011 +0000
+++ b/gpp/core/functions.py	Sun Jan 30 20:02:32 2011 +0000
@@ -1,6 +1,7 @@
 """This file houses various core utility functions for GPP"""
 import datetime
 import re
+import logging
 
 import django.core.mail
 from django.contrib.sites.models import Site
@@ -23,17 +24,16 @@
         django.core.mail.send_mail(subject, message, from_email, recipient_list,
                 fail_silently, auth_user, auth_password)
 
-    import logging
-    logging.debug('EMAIL:\nFrom: %s\nTo: %s\nSubject: %s\nMessage:\n%s' %
-            (from_email, str(recipient_list), subject, message))
+    logging.debug('EMAIL:\nFrom: %s\nTo: %s\nSubject: %s\nMessage:\n%s',
+        from_email, str(recipient_list), subject, message)
 
 
 def email_admins(subject, message):
     """Emails the site admins. Goes through the site send_mail function."""
     site = Site.objects.get_current()
     subject = '[%s] %s' % (site.name, subject)
-    send_mail(subject, 
-            message, 
+    send_mail(subject,
+            message,
             '%s@%s' % (settings.GPP_NO_REPLY_EMAIL, site.domain),
             [mail_tuple[1] for mail_tuple in settings.ADMINS])
 
@@ -42,8 +42,8 @@
     """Emails the site managers. Goes through the site send_mail function."""
     site = Site.objects.get_current()
     subject = '[%s] %s' % (site.name, subject)
-    send_mail(subject, 
-            msg, 
+    send_mail(subject,
+            msg,
             '%s@%s' % (settings.GPP_NO_REPLY_EMAIL, site.domain),
             [mail_tuple[1] for mail_tuple in settings.MANAGERS])