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

Fixed #15298 -- Raise a better error when a TemplateResponseMixin doesn't have a template_name defined. Thanks to rasca for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15532 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2011-02-14 13:05:14 +00:00
parent 06b22963ea
commit bb26c328ec
5 changed files with 23 additions and 3 deletions

View File

@@ -102,7 +102,9 @@ class TemplateResponseMixin(object):
a list. May not be called if render_to_response is overridden.
"""
if self.template_name is None:
return []
raise ImproperlyConfigured(
"TemplateResponseMixin requires either a definition of "
"'template_name' or an implementation of 'get_template_names()'")
else:
return [self.template_name]