refactor: improve score distribution display and enhance HTMX handling in exam views
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user