Ticket #16866: handle_empty_list_of_templates.diff

File handle_empty_list_of_templates.diff, 614 bytes (added by Silver_Ghost, 13 years ago)

handling empty list of candidates for select_template

  • django/template/loader.py

     
    180180def select_template(template_name_list):
    181181    "Given a list of template names, returns the first that can be loaded."
    182182    not_found = []
     183    if not template_name_list:
     184        raise ValueError("Couldn't choose template for load since there are"
     185                         " no candidates")
    183186    for template_name in template_name_list:
    184187        try:
    185188            return get_template(template_name)
Back to Top