mirror of
https://github.com/jazzband/django-axes.git
synced 2026-05-20 13:21:53 +00:00
style: apply black formatting
This commit is contained in:
parent
c9563bc29c
commit
ef91ba9b61
1 changed files with 5 additions and 1 deletions
|
|
@ -100,6 +100,7 @@ def get_cool_off_iso8601(delta: timedelta) -> str:
|
|||
return f"P{days_str}T{time_str}"
|
||||
return f"P{days_str}"
|
||||
|
||||
|
||||
def get_attempt_expiration(request: Optional[HttpRequest] = None) -> datetime:
|
||||
"""
|
||||
Get threshold for fetching access attempts from the database.
|
||||
|
|
@ -116,6 +117,7 @@ def get_attempt_expiration(request: Optional[HttpRequest] = None) -> datetime:
|
|||
return datetime.now() + cool_off
|
||||
return attempt_time + cool_off
|
||||
|
||||
|
||||
def get_credentials(username: Optional[str] = None, **kwargs) -> dict:
|
||||
"""
|
||||
Calculate credentials for Axes to use internally from given username and kwargs.
|
||||
|
|
@ -521,7 +523,9 @@ def get_lockout_response(
|
|||
return json_response
|
||||
|
||||
if settings.AXES_LOCKOUT_TEMPLATE:
|
||||
response = render(request, settings.AXES_LOCKOUT_TEMPLATE, context, status=status)
|
||||
response = render(
|
||||
request, settings.AXES_LOCKOUT_TEMPLATE, context, status=status
|
||||
)
|
||||
_set_retry_after_header(response, request)
|
||||
return response
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue