aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels/template.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-11-10 19:02:32 +0100
committerAymeric Augustin2013-11-10 19:02:32 +0100
commit28dac268782b1e9b2c0bce1b9d8aad5fc4673a1d (patch)
tree9987b69eb6116eacfd134fabb785a77727c30eaa /debug_toolbar/panels/template.py
parentd889bf25d98e6d3c8dde01b207f9ba5f3d91a806 (diff)
downloaddjango-debug-toolbar-28dac268782b1e9b2c0bce1b9d8aad5fc4673a1d.tar.bz2
template.name may be something other than a string.
Fix #389.
Diffstat (limited to 'debug_toolbar/panels/template.py')
-rw-r--r--debug_toolbar/panels/template.py7
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 = []