Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions debug_toolbar/panels/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def __init__(self, *args, **kwargs):
template_rendered.connect(self._store_template_info)

def _store_template_info(self, sender, **kwargs):
t = kwargs['template']
if t.name and t.name.startswith('debug_toolbar/'):
return # skip templates that we are generating through the debug toolbar.
context_data = kwargs['context']

context_list = []
Expand Down Expand Up @@ -95,8 +98,7 @@ def nav_title(self):
return _('Templates')

def title(self):
num_templates = len([t for t in self.templates
if not (t['template'].name and t['template'].name.startswith('debug_toolbar/'))])
num_templates = len(self.templates)
return _('Templates (%(num_templates)s rendered)') % {'num_templates': num_templates}

def url(self):
Expand All @@ -117,9 +119,6 @@ def process_response(self, request, response):
info = {}
# 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 and template.name.startswith('debug_toolbar/'):
continue
if not hasattr(template, 'origin'):
continue
if template.origin and template.origin.name:
Expand Down