This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/authentik/lib/views.py
Jens Langhammer 7c6185b581 api: fix URL names for admin Authenticator Views
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
2021-05-21 19:53:40 +02:00

20 lines
545 B
Python

"""authentik helper views"""
from django.http import HttpRequest
from django.template.response import TemplateResponse
from django.utils.translation import gettext_lazy as _
def bad_request_message(
request: HttpRequest,
message: str,
title="Bad Request",
template="error/generic.html",
) -> TemplateResponse:
"""Return generic error page with message, with status code set to 400"""
return TemplateResponse(
request,
template,
{"message": message, "title": _(title)},
status=400,
)