diff options
| author | David Cramer | 2013-04-29 12:24:42 -0700 |
|---|---|---|
| committer | David Cramer | 2013-04-29 12:24:42 -0700 |
| commit | 03334188ce55237794e6fe0ed85ed9629f561adc (patch) | |
| tree | c9fee1a6bcc8b2f5d450ac8dfb48ef59782d9413 /debug_toolbar/panels | |
| parent | 98c4ec3869eddf556e63880d2b36ef11013704a3 (diff) | |
| download | django-debug-toolbar-03334188ce55237794e6fe0ed85ed9629f561adc.tar.bz2 | |
Handle db aliases which are not defined in connections
Diffstat (limited to 'debug_toolbar/panels')
| -rw-r--r-- | debug_toolbar/panels/sql.py | 4 |
1 files changed, 3 insertions, 1 deletions
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': |
