diff options
| author | Carl Meyer <carl@oddbird.net> | 2011-09-21 14:20:18 +0000 |
|---|---|---|
| committer | Carl Meyer <carl@oddbird.net> | 2011-09-21 14:20:18 +0000 |
| commit | 75199e8f6d96887c10ba79870428e04ed34e1ca5 (patch) | |
| tree | 2b967d0c86ada3d23abed2450505778848d986a5 /django | |
| parent | 09a01435de65989864d56a8bf74ff2d84e9c4bd5 (diff) | |
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
Diffstat (limited to 'django')
| -rw-r--r-- | django/template/loader.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/template/loader.py b/django/template/loader.py index e10533393d..418501713d 100644 --- a/django/template/loader.py +++ b/django/template/loader.py @@ -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: |
