File tree 1 file changed +9
-1
lines changed
src/flask_debugtoolbar/panels
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 6
6
else :
7
7
try :
8
8
from flask_sqlalchemy .record_queries import get_recorded_queries
9
+ debug_enables_record_queries = False
9
10
except ImportError :
10
11
# For flask_sqlalchemy < 3.0.0
11
12
from flask_sqlalchemy import get_debug_queries as get_recorded_queries
12
13
14
+ # flask_sqlalchemy < 3.0.0 automatically enabled
15
+ # SQLALCHEMY_RECORD_QUERIES in debug or test mode
16
+ debug_enables_record_queries = True
17
+
13
18
location_property = 'context'
14
19
else :
15
20
location_property = 'location'
@@ -62,7 +67,10 @@ def extension_used():
62
67
63
68
64
69
def 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
+ )
66
74
67
75
68
76
def is_available ():
You can’t perform that action at this time.
0 commit comments