summaryrefslogtreecommitdiff
path: root/django/views/generic/base.py
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2020-01-05 10:04:51 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-01-06 13:50:43 +0100
commit2ea3fb3e6386c43f124b542e92b817dbc227c76b (patch)
tree2decee1530b738f997c05b2c9b4438659125935a /django/views/generic/base.py
parent1487f16f2d29c7aeaf48117d02a1d7bbeafa3d94 (diff)
Removed "Don't do that" from docs and error messages.
It's slightly aggressive and doesn't explain itself.
Diffstat (limited to 'django/views/generic/base.py')
-rw-r--r--django/views/generic/base.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/views/generic/base.py b/django/views/generic/base.py
index 0d6e31e195..3dd957d8f8 100644
--- a/django/views/generic/base.py
+++ b/django/views/generic/base.py
@@ -50,9 +50,10 @@ class View:
"""Main entry point for a request-response process."""
for key in initkwargs:
if key in cls.http_method_names:
- raise TypeError("You tried to pass in the %s method name as a "
- "keyword argument to %s(). Don't do that."
- % (key, cls.__name__))
+ raise TypeError(
+ 'The method name %s is not accepted as a keyword argument '
+ 'to %s().' % (key, cls.__name__)
+ )
if not hasattr(cls, key):
raise TypeError("%s() received an invalid keyword %r. as_view "
"only accepts arguments that are already "