Mercurial > public > sg101
comparison gpp/antispam/__init__.py @ 503:2c2df8545112
Changed the lockout time on logins to 2 minutes.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 03 Dec 2011 15:07:01 +0000 |
parents | 7c3816d76c6c |
children |
comparison
equal
deleted
inserted
replaced
502:9d096ceab0c0 | 503:2c2df8545112 |
---|---|
1 import datetime | |
2 | |
1 from django.contrib.auth import views as auth_views | 3 from django.contrib.auth import views as auth_views |
2 | 4 |
3 from antispam.decorators import rate_limit | 5 from antispam.decorators import rate_limit |
4 | 6 |
5 SPAM_PHRASE_KEY = "antispam.spam_phrases" | 7 SPAM_PHRASE_KEY = "antispam.spam_phrases" |
6 BUSTED_MESSAGE = ("Your post has tripped our spam filter. Your account has " | 8 BUSTED_MESSAGE = ("Your post has tripped our spam filter. Your account has " |
7 "been suspended pending a review of your post. If this was a mistake " | 9 "been suspended pending a review of your post. If this was a mistake " |
8 "then we apologize; your account will be restored shortly.") | 10 "then we apologize; your account will be restored shortly.") |
9 | 11 |
10 # Install rate limiting on auth login | 12 # Install rate limiting on auth login |
11 auth_views.login = rate_limit()(auth_views.login) | 13 auth_views.login = rate_limit(lockout=datetime.timedelta(minutes=2))(auth_views.login) |