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:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user