2023-10-09 22:02:05 +02:00
|
|
|
from django.http import HttpResponseForbidden
|
2021-03-31 21:30:51 +02:00
|
|
|
from django.shortcuts import render
|
|
|
|
|
2023-10-09 21:50:50 +02:00
|
|
|
|
2023-10-09 22:29:29 +02:00
|
|
|
def csrf_error(request, reason=""):
|
|
|
|
""" Jednoduchý „template view“ (třída to být nemůže) pro CSRF chyby """
|
2023-10-09 21:50:50 +02:00
|
|
|
return render(
|
|
|
|
request, 'various/403_csrf.html',
|
2023-10-22 15:21:24 +02:00
|
|
|
{"url": request.META.get("HTTP_REFERER", None), "reason": reason},
|
2023-10-09 22:02:05 +02:00
|
|
|
status=HttpResponseForbidden.status_code,
|
2023-10-09 21:50:50 +02:00
|
|
|
)
|