mirror of
https://github.com/jazzband/django-axes.git
synced 2026-05-11 09:03:12 +00:00
19 lines
494 B
Python
19 lines
494 B
Python
from axes.models import AccessAttempt
|
|
|
|
|
|
def reset(ip=None, silent=False):
|
|
if not ip:
|
|
attempts = AccessAttempt.objects.all()
|
|
if attempts:
|
|
attempts.delete()
|
|
else:
|
|
if not silent:
|
|
print 'No attempts found.'
|
|
else:
|
|
try:
|
|
attempt = AccessAttempt.objects.get(ip_address=ip)
|
|
except:
|
|
if not silent:
|
|
print 'No matching attempt found.'
|
|
else:
|
|
attempt.delete()
|