From 04e1d2e242aa752c63c63066a38064438f9d2e97 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 5 Oct 2008 18:02:17 -0400 Subject: better fix --- debug_toolbar/panels/sql.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debug_toolbar') diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py index 6b3f918..7584bd7 100644 --- a/debug_toolbar/panels/sql.py +++ b/debug_toolbar/panels/sql.py @@ -21,7 +21,7 @@ class DatabaseStatTracker(util.CursorDebugWrapper): stop = time.time() _params = None try: - _params = simplejson.dumps(params) + _params = simplejson.dumps([force_unicode(x) for x in params]) except TypeError: pass # object not JSON serializable # We keep `sql` to maintain backwards compatibility @@ -29,7 +29,7 @@ class DatabaseStatTracker(util.CursorDebugWrapper): 'sql': self.db.ops.last_executed_query(self.cursor, sql, params), 'time': stop - start, 'raw_sql': sql, - 'params': _params and [force_unicode(x) for x in _params] or _params, + 'params': _params, 'hash': sha_constructor(settings.SECRET_KEY + sql + _params).hexdigest(), }) util.CursorDebugWrapper = DatabaseStatTracker -- cgit v1.2.3