diff --git a/defender/config.py b/defender/config.py index e43a570..765ae7c 100644 --- a/defender/config.py +++ b/defender/config.py @@ -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 diff --git a/defender/utils.py b/defender/utils.py index 5355f98..508fdee 100644 --- a/defender/utils.py +++ b/defender/utils.py @@ -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.