Skip to content
Closed
Changes from 1 commit
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
Next Next commit
Non-Djano templates may not have a name or origin property.
  • Loading branch information
nyergler committed May 26, 2011
commit 3a0c2fc820584afee4116d3eaab7b4ee95c254c2
5 changes: 3 additions & 2 deletions debug_toolbar/panels/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ def content(self):
]
)
template_context = []

for template_data in self.templates:
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/'):
if hasattr(template, 'name') and template.name.startswith('debug_toolbar/'):
continue
if template.origin and template.origin.name:
if hasattr(template, 'origin') and template.origin.name:
template.origin_name = template.origin.name
else:
template.origin_name = 'No origin'
Expand Down