From 03334188ce55237794e6fe0ed85ed9629f561adc Mon Sep 17 00:00:00 2001 From: David Cramer Date: Mon, 29 Apr 2013 12:24:42 -0700 Subject: Handle db aliases which are not defined in connections --- debug_toolbar/panels/sql.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'debug_toolbar/panels') diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py index 74729c7..4bfdd27 100644 --- a/debug_toolbar/panels/sql.py +++ b/debug_toolbar/panels/sql.py @@ -77,9 +77,11 @@ class SQLDebugPanel(DebugPanel): self._transaction_ids = {} def get_transaction_id(self, alias): + if alias not in connections: + return conn = connections[alias].connection if not conn: - return None + return engine = conn.__class__.__module__.split('.', 1)[0] if engine == 'psycopg2': -- cgit v1.2.3