Skip to content

Accommodate sites where middleware toggles between URL configurations. #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
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
Prev Previous commit
Next Next commit
Non-Djano templates may not have a name or origin property.
  • Loading branch information
nyergler committed May 21, 2011
commit 686ee0718ba8be99e692888d630b7844a7734d97
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