Suppress mypy type errors

Update Mypy Python version to 3.14
This commit is contained in:
Aleksi Häkli 2026-02-11 21:53:12 +02:00
parent 23ee2fca44
commit d59a289407
4 changed files with 5 additions and 5 deletions

View file

@ -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"]

View file

@ -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

View file

@ -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"

View file

@ -1,5 +1,5 @@
[mypy]
python_version = 3.12
python_version = 3.14
ignore_missing_imports = True
[mypy-axes.migrations.*]