aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/utils
diff options
context:
space:
mode:
Diffstat (limited to 'debug_toolbar/utils')
-rw-r--r--debug_toolbar/utils/__init__.py6
-rw-r--r--debug_toolbar/utils/sql.py2
2 files changed, 3 insertions, 5 deletions
diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py
index 297c901..75f3024 100644
--- a/debug_toolbar/utils/__init__.py
+++ b/debug_toolbar/utils/__init__.py
@@ -7,6 +7,7 @@ import sys
from django.conf import settings
from django.views.debug import linebreak_iter
+from django.utils.encoding import force_text
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils import six
@@ -39,10 +40,7 @@ def tidy_stacktrace(stack):
continue
if socketserver_path in s_path:
continue
- if not text:
- text = ''
- else:
- text = (''.join(text)).strip()
+ text = (''.join(force_text(t) for t in text)).strip() if text else ''
trace.append((path, line_no, func_name, text))
return trace
diff --git a/debug_toolbar/utils/sql.py b/debug_toolbar/utils/sql.py
index 4e0d70d..2810699 100644
--- a/debug_toolbar/utils/sql.py
+++ b/debug_toolbar/utils/sql.py
@@ -29,5 +29,5 @@ def reformat_sql(sql):
def swap_fields(sql):
- return re.sub('SELECT</strong> (.*?) <strong>FROM', 'SELECT</strong> <a class="djDebugUncollapsed djDebugToggle" href="#">&bull;&bull;&bull;</a> ' +
+ return re.sub('SELECT</strong> (.*?) <strong>FROM', 'SELECT</strong> <a class="djDebugUncollapsed djDebugToggle" href="#">&#8226;&#8226;&#8226;</a> ' +
'<a class="djDebugCollapsed djDebugToggle" href="#">\g<1></a> <strong>FROM', sql)