mirror of
https://github.com/jazzband/django-axes.git
synced 2026-03-16 22:30:23 +00:00
Suppress mypy type errors
Update Mypy Python version to 3.14
This commit is contained in:
parent
23ee2fca44
commit
d59a289407
4 changed files with 5 additions and 5 deletions
|
|
@ -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
|
# 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
|
# Because callable failure limit requires scope of request object
|
||||||
list_display.append("status")
|
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"]
|
search_fields = ["ip_address", "username", "user_agent", "path_info"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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"
|
"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:
|
if attempt_time is None:
|
||||||
return now() - cool_off
|
return now() - cool_off
|
||||||
return attempt_time - cool_off
|
return attempt_time - cool_off
|
||||||
|
|
|
||||||
|
|
@ -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"
|
"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:
|
if attempt_time is None:
|
||||||
return datetime.now() + cool_off
|
return datetime.now() + cool_off
|
||||||
return attempt_time + cool_off
|
return attempt_time + cool_off
|
||||||
|
|
@ -162,7 +162,7 @@ def get_client_username(
|
||||||
log.debug(
|
log.debug(
|
||||||
"Using parameter credentials to get username with key settings.AXES_USERNAME_FORM_FIELD"
|
"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(
|
log.debug(
|
||||||
"Using parameter request.POST to get username with key settings.AXES_USERNAME_FORM_FIELD"
|
"Using parameter request.POST to get username with key settings.AXES_USERNAME_FORM_FIELD"
|
||||||
|
|
|
||||||
2
mypy.ini
2
mypy.ini
|
|
@ -1,5 +1,5 @@
|
||||||
[mypy]
|
[mypy]
|
||||||
python_version = 3.12
|
python_version = 3.14
|
||||||
ignore_missing_imports = True
|
ignore_missing_imports = True
|
||||||
|
|
||||||
[mypy-axes.migrations.*]
|
[mypy-axes.migrations.*]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue