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
2022-09-03 19:46:37 +02:00

20 lines
540 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="if/error.html",
) -> TemplateResponse:
"""Return generic error page with message, with status code set to 400"""
return TemplateResponse(
request,
template,
{"message": message, "title": _(title)},
status=400,
)