mirror of
https://github.com/jazzband/django-defender.git
synced 2026-04-30 11:44:47 +00:00
commit
This commit is contained in:
parent
785130bbd6
commit
185a8dee43
2 changed files with 2 additions and 5 deletions
|
|
@ -71,9 +71,6 @@ def get_approx_account_lockouts_from_login_attempts(ip_address=None, username=No
|
|||
|
||||
lockouts = AccessAttempt.objects.filter(q).count() // failure_limit
|
||||
|
||||
# Cache for the same window length used by the DB query.
|
||||
cache_ttl = int(config.ACCESS_ATTEMPT_EXPIRATION * 60 * 60)
|
||||
|
||||
redis_client.set(cache_key, int(lockouts), cache_ttl)
|
||||
redis_client.set(cache_key, int(lockouts), 60)
|
||||
|
||||
return lockouts
|
||||
|
|
|
|||
|
|
@ -976,7 +976,7 @@ class AccessAttemptTest(DefenderTestCase):
|
|||
ip_address="127.0.0.1", username=VALID_USERNAME
|
||||
)
|
||||
)
|
||||
self.assertIsNone(cached_value)
|
||||
self.assertIsNotNone(cached_value)
|
||||
|
||||
|
||||
class SignalTest(DefenderTestCase):
|
||||
|
|
|
|||
Loading…
Reference in a new issue