File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/flask_debugtoolbar/panels Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 66else :
77 try :
88 from flask_sqlalchemy .record_queries import get_recorded_queries
9+ debug_enables_record_queries = False
910 except ImportError :
1011 # For flask_sqlalchemy < 3.0.0
1112 from flask_sqlalchemy import get_debug_queries as get_recorded_queries
1213
14+ # flask_sqlalchemy < 3.0.0 automatically enabled
15+ # SQLALCHEMY_RECORD_QUERIES in debug or test mode
16+ debug_enables_record_queries = True
17+
1318 location_property = 'context'
1419 else :
1520 location_property = 'location'
@@ -62,7 +67,10 @@ def extension_used():
6267
6368
6469def recording_enabled ():
65- return (current_app .debug or current_app .config .get ('SQLALCHEMY_RECORD_QUERIES' ))
70+ return (
71+ (debug_enables_record_queries and current_app .debug ) or
72+ current_app .config .get ('SQLALCHEMY_RECORD_QUERIES' )
73+ )
6674
6775
6876def is_available ():
You can’t perform that action at this time.
0 commit comments