1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #16866 -- Clearer error message if empty list is passed to select_template. Thanks Silver_Ghost for report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16861 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Carl Meyer
2011-09-21 14:20:18 +00:00
parent 09a01435de
commit 75199e8f6d
2 changed files with 13 additions and 0 deletions

View File

@@ -179,6 +179,8 @@ def render_to_string(template_name, dictionary=None, context_instance=None):
def select_template(template_name_list):
"Given a list of template names, returns the first that can be loaded."
if not template_name_list:
raise TemplateDoesNotExist("No template names provided")
not_found = []
for template_name in template_name_list:
try: