From c9cbbb4c5b636676674379367f072c08c0e78f84 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 13 Jun 2009 00:14:37 +0800 Subject: only conditionally include the Django 1.1 signal for backwards compatibility Signed-off-by: Rob Hudson --- debug_toolbar/panels/signals.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'debug_toolbar') diff --git a/debug_toolbar/panels/signals.py b/debug_toolbar/panels/signals.py index 0a75282..7fe382e 100644 --- a/debug_toolbar/panels/signals.py +++ b/debug_toolbar/panels/signals.py @@ -3,12 +3,16 @@ import sys from django.conf import settings from django.core.signals import request_started, request_finished, \ got_request_exception -from django.db.backends.signals import connection_created from django.db.models.signals import class_prepared, pre_init, post_init, \ pre_save, post_save, pre_delete, post_delete, post_syncdb from django.dispatch.dispatcher import WEAKREF_TYPES from django.template.loader import render_to_string +try: + from django.db.backends.signals import connection_created +except ImportError: + connection_created = None + from debug_toolbar.panels import DebugPanel class SignalDebugPanel(DebugPanel): @@ -56,6 +60,8 @@ class SignalDebugPanel(DebugPanel): keys.sort() for name in keys: signal = self.signals[name] + if signal is None: + continue receivers = [] for (receiverkey, r_senderkey), receiver in signal.receivers: if isinstance(receiver, WEAKREF_TYPES): -- cgit v1.2.3 From 4dc0710b6a5eedec0448909f6b90e55a4f3555d4 Mon Sep 17 00:00:00 2001 From: Philip Zeyliger Date: Sat, 2 May 2009 00:46:02 +0800 Subject: Captured redirection requests must be urlencoded. I ran into this when I had a URL with a ? (%3F) mark in it. Signed-off-by: Rob Hudson --- debug_toolbar/templates/debug_toolbar/redirect.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debug_toolbar') diff --git a/debug_toolbar/templates/debug_toolbar/redirect.html b/debug_toolbar/templates/debug_toolbar/redirect.html index afdccc4..1f5c84b 100644 --- a/debug_toolbar/templates/debug_toolbar/redirect.html +++ b/debug_toolbar/templates/debug_toolbar/redirect.html @@ -3,7 +3,7 @@

HttpResponseRedirect

-

Location: {{ redirect_to }}

+

Location: {{ redirect_to }}

The Django Debug Toolbar has intercepted a redirect to the above URL for debug viewing purposes. You can click the above link to continue with the -- cgit v1.2.3 From 658c7384112cc45ec04343b03ce7f670b012ab0e Mon Sep 17 00:00:00 2001 From: Mike Korobov Date: Thu, 23 Jul 2009 16:48:41 +0800 Subject: Bypass context variables which 'repr' is broken. Signed-off-by: Rob Hudson --- debug_toolbar/panels/template.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'debug_toolbar') diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py index 7dc7b06..b548287 100644 --- a/debug_toolbar/panels/template.py +++ b/debug_toolbar/panels/template.py @@ -72,7 +72,14 @@ class TemplateDebugPanel(DebugPanel): info['template'] = t # Clean up context for better readability c = d.get('context', None) - info['context'] = '\n'.join([pformat(_d) for _d in c.dicts]) + + d_list = [] + for _d in c.dicts: + try: + d_list.append(pformat(d)) + except UnicodeEncodeError: + pass + info['context'] = '\n'.join(d_list) template_context.append(info) context = { 'templates': template_context, -- cgit v1.2.3