Skip to content

Instantly share code, notes, and snippets.

@Kronuz
Created April 13, 2011 17:59
Show Gist options
  • Save Kronuz/918024 to your computer and use it in GitHub Desktop.
Save Kronuz/918024 to your computer and use it in GitHub Desktop.
Fixes a couple bugs in django-debug-tolbar
diff -ruN debug_toolbar copy/panels/sql.py debug_toolbar/panels/sql.py
--- debug_toolbar copy/panels/sql.py 2011-04-11 12:32:10.000000000 -0500
+++ debug_toolbar/panels/sql.py 2011-04-13 12:48:38.000000000 -0500
@@ -197,7 +197,7 @@
i += 1
if trans_id:
- self._queries[i][1]['ends_trans'] = True
+ self._queries[i-1][1]['ends_trans'] = True
context = self.context.copy()
context.update({
diff -ruN debug_toolbar copy/panels/template.py debug_toolbar/panels/template.py
--- debug_toolbar copy/panels/template.py 2011-04-11 12:32:10.000000000 -0500
+++ debug_toolbar/panels/template.py 2011-04-13 12:49:02.000000000 -0500
@@ -56,7 +56,7 @@
def title(self):
num_templates = len([t for t in self.templates
- if not t['template'].name.startswith('debug_toolbar/')])
+ if not t['template'].name or not t['template'].name.startswith('debug_toolbar/')])
return _('Templates (%(num_templates)s rendered)') % {'num_templates': num_templates}
def url(self):
@@ -78,7 +78,7 @@
# Clean up some info about templates
template = template_data.get('template', None)
# Skip templates that we are generating through the debug toolbar.
- if template.name.startswith('debug_toolbar/'):
+ if template.name and template.name.startswith('debug_toolbar/'):
continue
if template.origin and template.origin.name:
template.origin_name = template.origin.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment