# Path: axes/utils.py
# def reset(ip: str = None, username: str = None, ip_or_username=False) -> int:
#     """
#     Reset records that match IP or username, and return the count of removed attempts.
# 
#     This utility method is meant to be used from the CLI or via Python API.
#     """
# 
#     return AxesProxyHandler.reset_attempts(
#         ip_address=ip, username=username, ip_or_username=ip_or_username
#     )


from django.core.management.base import BaseCommand
from axes.utils import reset



class Command(BaseCommand):
    help = "Reset all access attempts and lockouts"

    def handle(self, *args, **options):
        count = reset()

        if count:
            self.stdout.write(f"{count} attempts removed.")
        else:

# Path: axes/utils.py
# def reset(ip: str = None, username: str = None, ip_or_username=False) -> int:
#     """
#     Reset records that match IP or username, and return the count of removed attempts.
# 
#     This utility method is meant to be used from the CLI or via Python API.
#     """
# 
#     return AxesProxyHandler.reset_attempts(
#         ip_address=ip, username=username, ip_or_username=ip_or_username
#     )


# Path: axes/management/commands/axes_reset.py
from django.core.management.base import BaseCommand
from axes.utils import reset




class Command(BaseCommand):
    help = "Reset all access attempts and lockouts"

    def handle(self, *args, **options):
        count = reset()

        if count:
            self.stdout.write(f"{count} attempts removed.")
        else:

            self.stdout.write("No attempts found.")