From eb7793807863a088cf7c67c34df7f31ad03cbc29 Mon Sep 17 00:00:00 2001 From: David Wolfe Date: Mon, 10 Feb 2014 09:36:40 -0400 Subject: Color-code SQL: minor code style changes --- debug_toolbar/panels/sql/panel.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'debug_toolbar') diff --git a/debug_toolbar/panels/sql/panel.py b/debug_toolbar/panels/sql/panel.py index cae5214..b7a9e4c 100644 --- a/debug_toolbar/panels/sql/panel.py +++ b/debug_toolbar/panels/sql/panel.py @@ -198,9 +198,8 @@ class SQLPanel(Panel): query['stacktrace'] = render_stacktrace(query['stacktrace']) i += 1 - if not trace_colors.get(query['stacktrace']): - c = colors.next() - trace_colors[query['stacktrace']] = c + if query['stacktrace'] not in trace_colors: + trace_colors[query['stacktrace']] = colors.next() query['trace_color'] = trace_colors[query['stacktrace']] if trans_id: -- cgit v1.2.3