summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-01-29 15:06:37 +0000
committerRamiro Morales <cramm0@gmail.com>2011-01-29 15:06:37 +0000
commita289eba59c72c8abab9722b2038ff74c366d0f04 (patch)
tree209f49e8a1cff9fe2444f816c81798a0e844acad
parent86b0d5c1eb8162dca097555947d18664f4ae3ebc (diff)
downloaddjango-a289eba59c72c8abab9722b2038ff74c366d0f04.tar.gz
[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
-rw-r--r--django/views/debug.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/django/views/debug.py b/django/views/debug.py
index 168884d9bf..d86c0ebf4b 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -90,16 +90,18 @@ class ExceptionReporter:
module = import_module(loader.__module__)
if hasattr(loader, '__class__'):
source_list_func = loader.get_template_sources
- loader_name = loader.__module__ + '.' + loader.__class__.__name__
else: # NOTE: Remember to remove this branch when we deprecate old template loaders in 1.4
source_list_func = module.get_template_sources
- loader_name = loader.__module__ + '.' + loader.__name__
# NOTE: This assumes exc_value is the name of the template that
# the loader attempted to load.
template_list = [{'name': t, 'exists': os.path.exists(t)} \
for t in source_list_func(str(self.exc_value))]
except (ImportError, AttributeError):
template_list = []
+ if hasattr(loader, '__class__'):
+ loader_name = loader.__module__ + '.' + loader.__class__.__name__
+ else: # NOTE: Remember to remove this branch when we deprecate old template loaders in 1.4
+ loader_name = loader.__module__ + '.' + loader.__name__
self.loader_debug_info.append({
'loader': loader_name,
'templates': template_list,