refactor: improve score distribution display and enhance HTMX handling in exam views

This commit is contained in:
Ross
2026-07-13 10:15:42 +01:00
parent 3a3ec75b1d
commit 66cca1a512
3 changed files with 22 additions and 10 deletions
+15
View File
@@ -417,6 +417,21 @@ CHANNEL_LAYERS = {
},
}
def show_toolbar(request):
if request.headers.get("HX-Request") or getattr(request, "htmx", False):
return False
if request.headers.get("x-requested-with") == "XMLHttpRequest":
return False
try:
from debug_toolbar.middleware import show_toolbar as default_show_toolbar
return default_show_toolbar(request)
except ImportError:
return False
DEBUG_TOOLBAR_CONFIG = {
"SHOW_TOOLBAR_CALLBACK": "rad.settings.show_toolbar",
}
try:
from .settings_local import *
except ImportError as e: