misc: hide debug toolbar in skeleton view (#41597)

This commit is contained in:
Benjamin Dauvergne 2020-04-20 21:06:43 +02:00
parent 9ddff4fab0
commit c81470efcf
1 changed files with 10 additions and 0 deletions

View File

@ -356,6 +356,16 @@ BOOKING_CALENDAR_CELL_ENABLED = False
LEGACY_CHART_CELL_ENABLED = False
NEWSLETTERS_CELL_ENABLED = False
def debug_show_toolbar(request):
from debug_toolbar.middleware import show_toolbar as dt_show_toolbar
return dt_show_toolbar(request) and not request.path.startswith('/__skeleton__/')
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': debug_show_toolbar
}
local_settings_file = os.environ.get('COMBO_SETTINGS_FILE',
os.path.join(os.path.dirname(__file__), 'local_settings.py'))
if os.path.exists(local_settings_file):