summaryrefslogtreecommitdiff
path: root/django/views
diff options
context:
space:
mode:
authorAndrew Miller <info@akmiller.co.uk>2024-12-15 21:04:29 +0000
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-12-18 13:08:14 +0100
commit3ee4c6a27ad520d4ecc3cded260d47cbccafb144 (patch)
tree6b40c303a597ad552204c1e56a27fa8cef4e7774 /django/views
parent0fc6d5362bfed3e2222fa3476139126ee08a4ff9 (diff)
Refs #26007 -- Improved the ImproperlyConfigured error message for SingleObjectTemplateResponseMixin.get_template_names().
Diffstat (limited to 'django/views')
-rw-r--r--django/views/generic/detail.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/views/generic/detail.py b/django/views/generic/detail.py
index 05ced1f25d..70e427c59b 100644
--- a/django/views/generic/detail.py
+++ b/django/views/generic/detail.py
@@ -171,7 +171,11 @@ class SingleObjectTemplateResponseMixin(TemplateResponseMixin):
# If we still haven't managed to find any template names, we should
# re-raise the ImproperlyConfigured to alert the user.
if not names:
- raise
+ raise ImproperlyConfigured(
+ "SingleObjectTemplateResponseMixin requires a definition "
+ "of 'template_name', 'template_name_field', or 'model'; "
+ "or an implementation of 'get_template_names()'."
+ )
return names