diff gpp/antispam/__init__.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 8c1832b9d815
children 2c2df8545112
line wrap: on
line diff
--- a/gpp/antispam/__init__.py	Wed Aug 17 02:02:20 2011 +0000
+++ b/gpp/antispam/__init__.py	Thu Aug 25 02:23:55 2011 +0000
@@ -1,4 +1,11 @@
+from django.contrib.auth import views as auth_views
+
+from antispam.decorators import rate_limit
+
 SPAM_PHRASE_KEY = "antispam.spam_phrases"
 BUSTED_MESSAGE = ("Your post has tripped our spam filter. Your account has "
         "been suspended pending a review of your post. If this was a mistake "
         "then we apologize; your account will be restored shortly.")
+
+# Install rate limiting on auth login
+auth_views.login = rate_limit()(auth_views.login)