diff options
Diffstat (limited to 'debug_toolbar/panels/template.py')
| -rw-r--r-- | debug_toolbar/panels/template.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py index 0715c0a..d620a38 100644 --- a/debug_toolbar/panels/template.py +++ b/debug_toolbar/panels/template.py @@ -51,22 +51,25 @@ class TemplateDebugPanel(DebugPanel): context_list = [] for context_layer in context_data.dicts: + temp_layer = {} if hasattr(context_layer, 'items'): for key, value in context_layer.items(): # Replace any request elements - they have a large # unicode representation and the request data is # already made available from the Request Vars panel. if isinstance(value, http.HttpRequest): - context_layer[key] = '<<request>>' + temp_layer[key] = '<<request>>' # Replace the debugging sql_queries element. The SQL # data is already made available from the SQL panel. elif key == 'sql_queries' and isinstance(value, list): - context_layer[key] = '<<sql_queries>>' + temp_layer[key] = '<<sql_queries>>' # Replace LANGUAGES, which is available in i18n context processor elif key == 'LANGUAGES' and isinstance(value, tuple): - context_layer[key] = '<<languages>>' + temp_layer[key] = '<<languages>>' + else: + temp_layer[key] = value try: - context_list.append(pformat(context_layer)) + context_list.append(pformat(temp_layer)) except UnicodeEncodeError: pass kwargs['context'] = context_list |
