From 9b7f4aab326067a3ad503887a4e42c9d76d0bc25 Mon Sep 17 00:00:00 2001 From: Ian Wilson Date: Fri, 6 Sep 2013 15:50:18 -0500 Subject: adds fix and test for when a template is not specified at all to render(). fixes #21058. by jambonrose and ianawilson --- django/views/debug.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'django') diff --git a/django/views/debug.py b/django/views/debug.py index 16f75df8c3..6a0f81876e 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -233,6 +233,10 @@ class ExceptionReporter(object): from django.template.loader import template_source_loaders self.template_does_not_exist = True self.loader_debug_info = [] + # If the template_source_loaders haven't been populated yet, you need + # to provide an empty list for this for loop to not fail. + if template_source_loaders is None: + template_source_loaders = [] for loader in template_source_loaders: try: source_list_func = loader.get_template_sources -- cgit v1.3