Skip to content

Commit 349be0b

Browse files
Fix py314-djqa CI checks
1 parent 1c678ec commit 349be0b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

axes/middleware.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def __init__(self, get_response: Callable) -> None:
4242
@staticmethod
4343
def set_retry_after_header(request: HttpRequest, response: HttpResponse) -> None:
4444
if settings.AXES_ENABLE_RETRY_AFTER_HEADER:
45-
response["Retry-After"] = str(int(get_cool_off(request).total_seconds()))
45+
cool_off = get_cool_off(request)
46+
if cool_off is not None:
47+
response["Retry-After"] = str(int(cool_off.total_seconds()))
4648

4749
def build_lockout_response(
4850
self,
@@ -75,8 +77,6 @@ async def __acall__(self, request: HttpRequest) -> HttpResponse:
7577
credentials = getattr(request, "axes_credentials", None)
7678
response = await sync_to_async(
7779
self.build_lockout_response, thread_sensitive=True
78-
)(
79-
request, response, credentials
80-
)
80+
)(request, response, credentials)
8181

8282
return response

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ignore_errors =
5252
5353
# QA runs type checks, linting, and code formatting checks
5454
[testenv:py314-djqa]
55-
stoponfail = false
55+
ignore_errors = true
5656
deps = -r requirements.txt
5757
commands =
5858
mypy axes

0 commit comments

Comments
 (0)