fixed pep8 issues

This commit is contained in:
Ken Cochrane 2015-10-21 16:44:12 -04:00
parent 64c5684c12
commit cc45409078
2 changed files with 6 additions and 4 deletions

View file

@ -20,7 +20,8 @@ FAILURE_LIMIT = get_setting('DEFENDER_LOGIN_FAILURE_LIMIT', 3)
LOCKOUT_BY_IP_USERNAME = get_setting(
'DEFENDER_LOCK_OUT_BY_IP_AND_USERNAME', False)
# if this is True, The users IP address will not get locked when there are too many login attempts.
# if this is True, The users IP address will not get locked when
# there are too many login attempts.
DISABLE_IP_LOCKOUT = get_setting('DEFENDER_DISABLE_IP_LOCKOUT', False)
# use a specific username field to retrieve from login POST data

View file

@ -193,9 +193,10 @@ def record_failed_attempt(ip_address, username):
# we need to return False
return not user_block
# we want to make sure both the IP and user is blocked before we return False
# this is mostly used when a lot of your users are using proxies, and you
# don't want one user to block everyone on that one IP.
# we want to make sure both the IP and user is blocked before we
# return False
# this is mostly used when a lot of your users are using proxies,
# and you don't want one user to block everyone on that one IP.
if config.LOCKOUT_BY_IP_USERNAME:
# both ip_block and user_block need to be True in order
# to return a False.