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/utils | |
| parent | 98c4ec3869eddf556e63880d2b36ef11013704a3 (diff) | |
| download | django-debug-toolbar-03334188ce55237794e6fe0ed85ed9629f561adc.tar.bz2 | |
Handle db aliases which are not defined in connections
Diffstat (limited to 'debug_toolbar/utils')
| -rw-r--r-- | debug_toolbar/utils/tracking/db.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/debug_toolbar/utils/tracking/db.py b/debug_toolbar/utils/tracking/db.py index 8a51c36..d649984 100644 --- a/debug_toolbar/utils/tracking/db.py +++ b/debug_toolbar/utils/tracking/db.py @@ -102,14 +102,6 @@ class NormalCursorWrapper(object): try: return self.cursor.execute(sql, params) finally: - # FIXME: Sometimes connections which are not in the connections - # dict are used (for example in test database destroying). - # The code below (at least get_transaction_id(alias) needs to have - # the connection in the connections dict. It would be good to - # not have this requirement at all, but for now lets just skip - # these connections. - if self.db.alias not in connections: - return stop = datetime.now() duration = ms_from_timedelta(stop - start) enable_stacktraces = getattr(settings, @@ -149,8 +141,8 @@ class NormalCursorWrapper(object): params = { 'engine': engine, 'alias': alias, - 'sql': self.db.ops.last_executed_query(self.cursor, sql, - self._quote_params(params)), + 'sql': self.db.ops.last_executed_query( + self.cursor, sql, self._quote_params(params)), 'duration': duration, 'raw_sql': sql, 'params': _params, |
