From f1b13595c0201222da99c4df98dd5383e3d68f31 Mon Sep 17 00:00:00 2001 From: John Eskew Date: Thu, 27 Jul 2017 16:59:08 -0400 Subject: [PATCH] Only display debug toolbar on non-ajax requests. --- cms/envs/devstack.py | 7 ++++++- lms/envs/devstack.py | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py index fecdef3e7d..46103bab4b 100644 --- a/cms/envs/devstack.py +++ b/cms/envs/devstack.py @@ -92,7 +92,12 @@ DEBUG_TOOLBAR_CONFIG = { def should_show_debug_toolbar(request): # We always want the toolbar on devstack unless running tests from another Docker container - return not request.get_host().startswith('edx.devstack.studio:') + if request.get_host().startswith('edx.devstack.studio:'): + return False + # Only display for non-ajax requests. + if request.is_ajax(): + return False + return True # To see stacktraces for MongoDB queries, set this to True. diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index b5317e2415..c817cae8a8 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -89,8 +89,12 @@ DEBUG_TOOLBAR_CONFIG = { def should_show_debug_toolbar(request): # We always want the toolbar on devstack unless running tests from another Docker container - return not request.get_host().startswith('edx.devstack.lms:') - + if request.get_host().startswith('edx.devstack.lms:'): + return False + # Only display for non-ajax requests. + if request.is_ajax(): + return False + return True ########################### PIPELINE #################################