diff --git a/django/template/base.py b/django/template/base.py
index d934e05..063b5db 100644
a
|
b
|
class TemplateSyntaxError(Exception):
|
61 | 61 | class TemplateDoesNotExist(Exception): |
62 | 62 | pass |
63 | 63 | |
| 64 | class IncludedTemplateDoesNotExist(Exception): |
| 65 | pass |
| 66 | |
64 | 67 | class TemplateEncodingError(Exception): |
65 | 68 | pass |
66 | 69 | |
diff --git a/django/template/loader.py b/django/template/loader.py
index 279d8e8..885cd16 100644
a
|
b
|
|
26 | 26 | # installed, because pkg_resources is necessary to read eggs. |
27 | 27 | |
28 | 28 | from django.core.exceptions import ImproperlyConfigured |
29 | | from django.template.base import Origin, Template, Context, TemplateDoesNotExist, add_to_builtins |
| 29 | from django.template.base import (Origin, Template, Context, |
| 30 | TemplateDoesNotExist, |
| 31 | IncludedTemplateDoesNotExist, |
| 32 | add_to_builtins) |
30 | 33 | from django.utils.importlib import import_module |
31 | 34 | from django.conf import settings |
32 | 35 | |
… |
… |
def get_template(template_name):
|
157 | 160 | template, origin = find_template(template_name) |
158 | 161 | if not hasattr(template, 'render'): |
159 | 162 | # template needs to be compiled |
160 | | template = get_template_from_string(template, origin, template_name) |
| 163 | try: |
| 164 | template = get_template_from_string(template, origin, template_name) |
| 165 | except TemplateDoesNotExist, included_template_name: |
| 166 | raise IncludedTemplateDoesNotExist, included_template_name |
161 | 167 | return template |
162 | 168 | |
163 | 169 | def get_template_from_string(source, origin=None, name=None): |
… |
… |
def select_template(template_name_list):
|
190 | 196 | for template_name in template_name_list: |
191 | 197 | try: |
192 | 198 | return get_template(template_name) |
193 | | except TemplateDoesNotExist: |
| 199 | except TemplateDoesNotExist, e: |
| 200 | if isinstance(e, IncludedTemplateDoesNotExist): |
| 201 | raise |
194 | 202 | continue |
195 | 203 | # If we get here, none of the templates could be loaded |
196 | 204 | raise TemplateDoesNotExist(', '.join(template_name_list)) |