Ticket #15158: 15158.1.diff

File 15158.1.diff, 1.5 KB (added by Ramiro Morales, 14 years ago)

Proposed fix for the issue

  • django/views/debug.py

    diff --git a/django/views/debug.py b/django/views/debug.py
    a b  
    9191                    module = import_module(loader.__module__)
    9292                    if hasattr(loader, '__class__'):
    9393                        source_list_func = loader.get_template_sources
    94                         loader_name = loader.__module__ + '.' + loader.__class__.__name__
    9594                    else: # NOTE: Remember to remove this branch when we deprecate old template loaders in 1.4
    9695                        source_list_func = module.get_template_sources
    97                         loader_name = loader.__module__ + '.' + loader.__name__
    9896                    # NOTE: This assumes exc_value is the name of the template that
    9997                    # the loader attempted to load.
    10098                    template_list = [{'name': t, 'exists': os.path.exists(t)} \
    10199                        for t in source_list_func(str(self.exc_value))]
    102100                except (ImportError, AttributeError):
    103101                    template_list = []
     102                if hasattr(loader, '__class__'):
     103                    loader_name = loader.__module__ + '.' + loader.__class__.__name__
     104                else: # NOTE: Remember to remove this branch when we deprecate old template loaders in 1.4
     105                    loader_name = loader.__module__ + '.' + loader.__name__
    104106                self.loader_debug_info.append({
    105107                    'loader': loader_name,
    106108                    'templates': template_list,
Back to Top