mirror of
https://github.com/pallets-eco/flask-debugtoolbar.git
synced 2026-01-04 12:39:33 -06:00
Import the json module from flask (which tries to find the best available one)
This commit is contained in:
@@ -6,8 +6,7 @@ except ImportError:
|
||||
get_debug_queries = None
|
||||
|
||||
|
||||
import simplejson
|
||||
from flask import current_app
|
||||
from flask import current_app, json
|
||||
from flaskext.debugtoolbar.panels import DebugPanel
|
||||
from flaskext.debugtoolbar.utils import format_fname, format_sql
|
||||
|
||||
@@ -51,7 +50,7 @@ class SQLAlchemyDebugPanel(DebugPanel):
|
||||
is_select = query.statement.strip().lower().startswith('select')
|
||||
_params = ''
|
||||
try:
|
||||
_params = simplejson.dumps(query.parameters)
|
||||
_params = json.dumps(query.parameters)
|
||||
except TypeError:
|
||||
pass # object not JSON serializable
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import hashlib
|
||||
|
||||
import simplejson
|
||||
from flask import Module, request, current_app, abort
|
||||
from flask import Module, request, current_app, abort, json
|
||||
from flaskext.sqlalchemy import SQLAlchemy
|
||||
from flaskext.debugtoolbar.utils import format_sql
|
||||
|
||||
@@ -52,7 +51,7 @@ def sql_explain(render):
|
||||
if not statement.lower().strip().startswith('select'):
|
||||
return abort(406)
|
||||
|
||||
params = simplejson.loads(params)
|
||||
params = json.loads(params)
|
||||
|
||||
db = SQLAlchemy(current_app)
|
||||
if db.engine.driver == 'pysqlite':
|
||||
|
||||
Reference in New Issue
Block a user