Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Fixed #15158 -- Fixed error introduced in r15252 in rendering…

… of the template post morten section of the 500 error debug page with loaders other than the file system or application dir loaders. Refs #15122. Thanks gsf for the report.

Backport of [15360] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15361 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a289eba59c72c8abab9722b2038ff74c366d0f04 1 parent 86b0d5c
Ramiro Morales authored January 29, 2011

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  django/views/debug.py
6  django/views/debug.py
@@ -90,16 +90,18 @@ def get_traceback_html(self):
90 90
                     module = import_module(loader.__module__)
91 91
                     if hasattr(loader, '__class__'):
92 92
                         source_list_func = loader.get_template_sources
93  
-                        loader_name = loader.__module__ + '.' + loader.__class__.__name__
94 93
                     else: # NOTE: Remember to remove this branch when we deprecate old template loaders in 1.4
95 94
                         source_list_func = module.get_template_sources
96  
-                        loader_name = loader.__module__ + '.' + loader.__name__
97 95
                     # NOTE: This assumes exc_value is the name of the template that
98 96
                     # the loader attempted to load.
99 97
                     template_list = [{'name': t, 'exists': os.path.exists(t)} \
100 98
                         for t in source_list_func(str(self.exc_value))]
101 99
                 except (ImportError, AttributeError):
102 100
                     template_list = []
  101
+                if hasattr(loader, '__class__'):
  102
+                    loader_name = loader.__module__ + '.' + loader.__class__.__name__
  103
+                else: # NOTE: Remember to remove this branch when we deprecate old template loaders in 1.4
  104
+                    loader_name = loader.__module__ + '.' + loader.__name__
103 105
                 self.loader_debug_info.append({
104 106
                     'loader': loader_name,
105 107
                     'templates': template_list,

0 notes on commit a289eba

Please sign in to comment.
Something went wrong with that request. Please try again.