diff gpp/accounts/forms.py @ 472:7c3816d76c6c

Implement rate limiting on registration and login for #224.
author Brian Neal <bgneal@gmail.com>
date Thu, 25 Aug 2011 02:23:55 +0000
parents 69d0306a6fe7
children b137a0966e4b
line wrap: on
line diff
--- a/gpp/accounts/forms.py	Wed Aug 17 02:02:20 2011 +0000
+++ b/gpp/accounts/forms.py	Thu Aug 25 02:23:55 2011 +0000
@@ -13,6 +13,7 @@
 from accounts.models import PendingUser
 from accounts.models import IllegalUsername
 from accounts.models import IllegalEmail
+from antispam.rate_limit import block_ip
 
 
 class RegisterForm(forms.Form):
@@ -109,6 +110,7 @@
         """
         answer = self.cleaned_data.get('question2')
         if answer:
+            block_ip(self.ip)
             self._validation_error('Wrong answer #2: %s' % answer)
         return answer