Debian Codegraph @

axes/management/commands/axes_reset.py

raw
1 from django.core.management.base import BaseCommand
2
3 from axes.utils import reset
4
5
6 class Command(BaseCommand):
7 help = "Reset all access attempts and lockouts"
8
9 def handle(self, *args, **options):
10 count = reset()
11
12 if count:
13 self.stdout.write(f"{count} attempts removed.")
14 else:
15 self.stdout.write("No attempts found.")