diff gpp/accounts/forms.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 efa3b4901777
line wrap: on
line diff
--- a/gpp/accounts/forms.py	Sat Jan 29 20:39:55 2011 +0000
+++ b/gpp/accounts/forms.py	Sun Jan 30 20:02:32 2011 +0000
@@ -24,13 +24,13 @@
     email = forms.EmailField()
     password1 = forms.CharField(label = "Password", widget = forms.PasswordInput)
     password2 = forms.CharField(label = "Password confirmation", widget = forms.PasswordInput)
-    agree_age = forms.BooleanField(required=True, 
+    agree_age = forms.BooleanField(required=True,
         label='I certify that I am over the age of 13',
         error_messages={
             'required': 'Sorry, but you must be over the age of 13 to ' \
                     'register at our site.',
             })
-    agree_tos = forms.BooleanField(required=True, 
+    agree_tos = forms.BooleanField(required=True,
        label='I agree to the Terms of Service',
         error_messages={
             'required': 'You have not agreed to our Terms of Service.',
@@ -96,7 +96,7 @@
         site = Site.objects.get_current()
         admin_email = settings.ADMINS[0][1]
 
-        activation_link = 'http://%s%s' % (site.domain, reverse('accounts.views.register_confirm', 
+        activation_link = 'http://%s%s' % (site.domain, reverse('accounts.views.register_confirm',
                 kwargs = {'username' : pending_user.username, 'key' : pending_user.key}))
 
         msg = render_to_string('accounts/registration_email.txt',
@@ -112,11 +112,11 @@
         subject = 'Registration Confirmation for ' + site.name
         send_mail(subject, msg, admin_email, [self.cleaned_data['email']],
                 expedite=True)
-        logging.info('Accounts/registration conf. email sent to %s for user %s; IP = %s' % \
-                (self.cleaned_data['email'], pending_user.username, self.ip))
+        logging.info('Accounts/registration conf. email sent to %s for user %s; IP = %s',
+                self.cleaned_data['email'], pending_user.username, self.ip)
 
         return pending_user
 
     def _validation_error(self, msg, param=None):
-        logging.error('Accounts/registration [%s]: %s (%s)' % (self.ip, msg, param))
+        logging.error('Accounts/registration [%s]: %s (%s)', self.ip, msg, param)
         raise forms.ValidationError(msg)