auth: add maintainer info to index and lockout

settings: move maintainer to __init__
This commit is contained in:
Rushil Umaretiya 2023-04-16 10:59:20 -04:00
parent 5799abb2bf
commit 3bdb9063ea
No known key found for this signature in database
GPG Key ID: 4E8FAF9C926AF959
3 changed files with 17 additions and 2 deletions

View File

@ -65,3 +65,14 @@ def accept_tos_view(request: HttpRequest) -> HttpResponse:
context = {"form": form}
return render(request, "authentication/accept_tos.html", context=context)
def lockout(request, *args, **kwargs):
return HttpResponse(
(
"Your account has been locked due to too many failed login attempts, ",
f"please contact {settings.MAINTAINER} for assistance ",
"<i>or remember your password next time!</i>",
),
status=403,
)

View File

@ -124,6 +124,9 @@ AUTHENTICATION_BACKENDS = (
"django.contrib.auth.backends.ModelBackend",
)
AXES_LOCKOUT_CALLABLE = "tjdests.apps.authentication.views.lockout"
MAINTAINER = ""
SOCIAL_AUTH_REDIRECT_IS_HTTPS = False
SOCIAL_AUTH_ION_KEY = ""
SOCIAL_AUTH_ION_SECRET = ""

View File

@ -30,8 +30,9 @@
</p>
<p>
This website is <a href="https://github.com/etnguyen03/tjdests" target="_blank">open source</a>,
and is © 2021 <a href="https://github.com/etnguyen03/tjdests/graphs/contributors" target="_blank">Ethan Nguyen and contributors</a>.
All rights reserved.
and is currently maintained by {{ settings.MAINTAINER }}<br>
<small>© 2021 <a href="https://github.com/etnguyen03/tjdests/graphs/contributors" target="_blank">Ethan Nguyen and contributors</a>.
All rights reserved.</small>
</p>
{% endblock %}