From d927012d75becf752699bd2cf0400873baac78d7 Mon Sep 17 00:00:00 2001 From: Ievgen Voloshchuk Date: Mon, 2 Apr 2012 14:26:04 +0200 Subject: [PATCH] Add configuration parameter to enable profiler by default --- flask_debugtoolbar/panels/profiler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flask_debugtoolbar/panels/profiler.py b/flask_debugtoolbar/panels/profiler.py index 03b8c61..96a5e9a 100644 --- a/flask_debugtoolbar/panels/profiler.py +++ b/flask_debugtoolbar/panels/profiler.py @@ -20,6 +20,11 @@ class ProfilerDebugPanel(DebugPanel): user_activate = True + def __init__(self, jinja_env, context={}): + DebugPanel.__init__(self, jinja_env, context=context) + if current_app.config.get('DEBUG_TB_PROFILER_ENABLED'): + self.is_active = True + def has_content(self): return bool(self.profiler)