diff --git a/axes/admin.py b/axes/admin.py index a0c208c..b5a9581 100644 --- a/axes/admin.py +++ b/axes/admin.py @@ -44,7 +44,7 @@ class AccessAttemptAdmin(admin.ModelAdmin): # This will only add the status field if AXES_FAILURE_LIMIT is set to a positive integer # Because callable failure limit requires scope of request object list_display.append("status") - list_filter.append(IsLockedOutFilter) + list_filter.append(IsLockedOutFilter) # type: ignore[arg-type] search_fields = ["ip_address", "username", "user_agent", "path_info"] diff --git a/axes/attempts.py b/axes/attempts.py index 83367f9..830f07e 100644 --- a/axes/attempts.py +++ b/axes/attempts.py @@ -20,7 +20,7 @@ def get_cool_off_threshold(request: Optional[HttpRequest] = None) -> datetime: "Cool off threshold can not be calculated with settings.AXES_COOLOFF_TIME set to None" ) - attempt_time = request.axes_attempt_time + attempt_time = request.axes_attempt_time # type: ignore[union-attr] if attempt_time is None: return now() - cool_off return attempt_time - cool_off diff --git a/axes/helpers.py b/axes/helpers.py index a0a195e..d526566 100644 --- a/axes/helpers.py +++ b/axes/helpers.py @@ -111,7 +111,7 @@ def get_attempt_expiration(request: Optional[HttpRequest] = None) -> datetime: "Cool off threshold can not be calculated with settings.AXES_COOLOFF_TIME set to None" ) - attempt_time = request.axes_attempt_time + attempt_time = request.axes_attempt_time # type: ignore[union-attr] if attempt_time is None: return datetime.now() + cool_off return attempt_time + cool_off @@ -162,7 +162,7 @@ def get_client_username( log.debug( "Using parameter credentials to get username with key settings.AXES_USERNAME_FORM_FIELD" ) - return credentials.get(settings.AXES_USERNAME_FORM_FIELD, None) + return credentials.get(settings.AXES_USERNAME_FORM_FIELD, None) # type: ignore[return-value] log.debug( "Using parameter request.POST to get username with key settings.AXES_USERNAME_FORM_FIELD" diff --git a/mypy.ini b/mypy.ini index 822d184..ef0be81 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,5 @@ [mypy] -python_version = 3.12 +python_version = 3.14 ignore_missing_imports = True [mypy-axes.migrations.*]