From 1a1c2eef67dbb5585f1ac25b1c742c3aa509d75a Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Mon, 31 Mar 2014 17:07:03 -0300 Subject: [PATCH] Respect SQLALCHEMY_RECORD_QUERIES even in debug mode. Fix #181 --- flask_sqlalchemy/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flask_sqlalchemy/__init__.py b/flask_sqlalchemy/__init__.py index 22941de6..2b110d5e 100644 --- a/flask_sqlalchemy/__init__.py +++ b/flask_sqlalchemy/__init__.py @@ -457,11 +457,11 @@ def __get__(self, obj, type): def _record_queries(app): - if app.debug: - return True rq = app.config['SQLALCHEMY_RECORD_QUERIES'] if rq is not None: return rq + if app.debug: + return True return bool(app.config.get('TESTING'))