From e88bda0685913de00062afe0eb973cdba9035d61 Mon Sep 17 00:00:00 2001 From: Sebastien Renard Date: Tue, 19 Nov 2024 15:47:03 +0100 Subject: [PATCH] display forbiden pages without menu for htmx fragment page as well as jquery pages --- core/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/views.py b/core/views.py index 6c9060d9..8f1c3af1 100644 --- a/core/views.py +++ b/core/views.py @@ -428,7 +428,7 @@ def tableToCSV(table, filename="data.csv"): def forbidden(request): """When access is denied...""" - if request.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest': + if request.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest' or request.META.get("HTTP_HX_REQUEST"): # Ajax request, use stripped forbidden page template = "core/_access_forbidden.html" else: