diff options
| author | Aymeric Augustin | 2013-11-10 19:02:32 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-11-10 19:02:32 +0100 |
| commit | 28dac268782b1e9b2c0bce1b9d8aad5fc4673a1d (patch) | |
| tree | 9987b69eb6116eacfd134fabb785a77727c30eaa /debug_toolbar | |
| parent | d889bf25d98e6d3c8dde01b207f9ba5f3d91a806 (diff) | |
| download | django-debug-toolbar-28dac268782b1e9b2c0bce1b9d8aad5fc4673a1d.tar.bz2 | |
template.name may be something other than a string.
Fix #389.
Diffstat (limited to 'debug_toolbar')
| -rw-r--r-- | debug_toolbar/panels/template.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py index 6523155..711193e 100644 --- a/debug_toolbar/panels/template.py +++ b/debug_toolbar/panels/template.py @@ -6,11 +6,13 @@ from pprint import pformat import django from django import http from django.conf import settings +from django.db.models.query import QuerySet, RawQuerySet from django.template.context import get_standard_processors from django.test.signals import template_rendered from django.utils.encoding import force_text +from django.utils import six from django.utils.translation import ugettext_lazy as _ -from django.db.models.query import QuerySet, RawQuerySet + from debug_toolbar.panels import DebugPanel from debug_toolbar.utils.tracking.db import recording, SQLQueryTriggered from debug_toolbar.utils.settings import CONFIG @@ -62,7 +64,8 @@ class TemplateDebugPanel(DebugPanel): template, context = kwargs['template'], kwargs['context'] # Skip templates that we are generating through the debug toolbar. - if template.name and template.name.startswith('debug_toolbar/'): + if (isinstance(template.name, six.string_types) and + template.name.startswith('debug_toolbar/')): return context_list = [] |
