From ab01a82b42a1e3641a79d4d14e8c96b03ba47298 Mon Sep 17 00:00:00 2001 From: Miguel Araujo Perez Date: Thu, 9 Jun 2011 20:58:46 +0200 Subject: Fixes TemplateDebugPanel iterating over an unknown template without origin or name --- debug_toolbar/panels/template.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py index 44b8b3e..1d543f9 100644 --- a/debug_toolbar/panels/template.py +++ b/debug_toolbar/panels/template.py @@ -78,6 +78,8 @@ class TemplateDebugPanel(DebugPanel): # Skip templates that we are generating through the debug toolbar. if template.name and template.name.startswith('debug_toolbar/'): continue + if template.name == "": + continue if template.origin and template.origin.name: template.origin_name = template.origin.name else: -- cgit v1.2.3 From d505f4975602d79c8d0650068569c524459dc5db Mon Sep 17 00:00:00 2001 From: Miguel Araujo Perez Date: Fri, 10 Jun 2011 11:31:01 +0200 Subject: Checking if the origin attribute exists on the Template object instead --- debug_toolbar/panels/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py index 1d543f9..3c70690 100644 --- a/debug_toolbar/panels/template.py +++ b/debug_toolbar/panels/template.py @@ -78,7 +78,7 @@ class TemplateDebugPanel(DebugPanel): # Skip templates that we are generating through the debug toolbar. if template.name and template.name.startswith('debug_toolbar/'): continue - if template.name == "": + if not hasattr(template, 'origin'): continue if template.origin and template.origin.name: template.origin_name = template.origin.name -- cgit v1.2.3