Only display debug toolbar on non-ajax requests.

This commit is contained in:
John Eskew
2017-07-27 16:59:08 -04:00
parent 8eb4e469ff
commit f1b13595c0
2 changed files with 12 additions and 3 deletions

View File

@@ -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.

View File

@@ -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 #################################