diff options
| author | Jannis Leidel | 2012-11-26 07:33:52 -0800 | 
|---|---|---|
| committer | Jannis Leidel | 2012-11-26 07:33:52 -0800 | 
| commit | 28f64e3093b8880a97737a85feffa26f2f02f0ec (patch) | |
| tree | e906ec8fadeb39e0fb4378c9ebb6c0c80d2257c4 /debug_toolbar | |
| parent | aeb45f2fea083fb182f5fd33e7c4980780b1ea81 (diff) | |
| parent | 706988514f3c0f508b671e9774c49e374df1795e (diff) | |
| download | django-debug-toolbar-28f64e3093b8880a97737a85feffa26f2f02f0ec.tar.bz2 | |
Merge pull request #291 from valsteen/master
prevent crash due to SQLDebugPanel when transaction is in error state
Diffstat (limited to 'debug_toolbar')
| -rw-r--r-- | debug_toolbar/utils/tracking/db.py | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/debug_toolbar/utils/tracking/db.py b/debug_toolbar/utils/tracking/db.py index 4d87090..70ff700 100644 --- a/debug_toolbar/utils/tracking/db.py +++ b/debug_toolbar/utils/tracking/db.py @@ -146,10 +146,11 @@ class NormalCursorWrapper(object):              }              if engine == 'psycopg2': +                from psycopg2.extensions import TRANSACTION_STATUS_INERROR                  params.update({                      'trans_id': self.logger.get_transaction_id(alias),                      'trans_status': conn.get_transaction_status(), -                    'iso_level': conn.isolation_level, +                    'iso_level': conn.isolation_level if not conn.get_transaction_status() == TRANSACTION_STATUS_INERROR else "",                      'encoding': conn.encoding,                  })  | 
