diff --git a/django/template/__init__.py b/django/template/__init__.py
index 5493e5b..6ed6bdd 100644
a
|
b
|
class TemplateSyntaxError(Exception):
|
121 | 121 | class TemplateDoesNotExist(Exception): |
122 | 122 | pass |
123 | 123 | |
| 124 | class IncludedTemplateDoesNotExist(TemplateDoesNotExist): |
| 125 | pass |
| 126 | |
124 | 127 | class TemplateEncodingError(Exception): |
125 | 128 | pass |
126 | 129 | |
diff --git a/django/template/loader.py b/django/template/loader.py
index 8195c4b..3a76ce5 100644
a
|
b
|
|
21 | 21 | # installed, because pkg_resources is necessary to read eggs. |
22 | 22 | |
23 | 23 | from django.core.exceptions import ImproperlyConfigured |
24 | | from django.template import Origin, Template, Context, TemplateDoesNotExist, add_to_builtins |
| 24 | from django.template import Origin, Template, Context, TemplateDoesNotExist, IncludedTemplateDoesNotExist, add_to_builtins |
25 | 25 | from django.utils.importlib import import_module |
26 | 26 | from django.conf import settings |
27 | 27 | |
… |
… |
def get_template(template_name):
|
79 | 79 | handling template inheritance recursively. |
80 | 80 | """ |
81 | 81 | source, origin = find_template_source(template_name) |
82 | | template = get_template_from_string(source, origin, template_name) |
| 82 | try: |
| 83 | template = get_template_from_string(source, origin, template_name) |
| 84 | except TemplateDoesNotExist, included_template_name: |
| 85 | raise IncludedTemplateDoesNotExist, included_template_name |
83 | 86 | return template |
84 | 87 | |
85 | 88 | def get_template_from_string(source, origin=None, name=None): |
… |
… |
def select_template(template_name_list):
|
112 | 115 | for template_name in template_name_list: |
113 | 116 | try: |
114 | 117 | return get_template(template_name) |
115 | | except TemplateDoesNotExist: |
| 118 | except TemplateDoesNotExist, e: |
| 119 | if isinstance(e, IncludedTemplateDoesNotExist): |
| 120 | raise |
116 | 121 | continue |
117 | 122 | # If we get here, none of the templates could be loaded |
118 | 123 | raise TemplateDoesNotExist, ', '.join(template_name_list) |