Permalink
Browse files

sql is None, in case of internal psycopg2 errors like 'cannot adapt t…

…ype ..'
  • Loading branch information...
1 parent 7b610e9 commit f4c5b01d961ee0f9892c80f08a872fdfa9cdde58 @overplumbum overplumbum committed Jun 7, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 debug_toolbar/panels/sql.py
@@ -170,7 +170,8 @@ def process_response(self, request, response):
query['iso_level'] = get_isolation_level_display(query['engine'], query['iso_level'])
if 'trans_status' in query:
query['trans_status'] = get_transaction_status_display(query['engine'], query['trans_status'])
- query['sql'] = reformat_sql(query['sql'])
+ if query['sql']:
+ query['sql'] = reformat_sql(query['sql'])
query['rgb_color'] = self._databases[alias]['rgb_color']
try:
query['width_ratio'] = (query['duration'] / self._sql_time) * 100

0 comments on commit f4c5b01

Please sign in to comment.