Change exception message for django.utils.decorators.classonlymethod
|Reported by:||Peter Zsoldos||Owned by:||Tim Graham|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The exception message when invoking it on an instance is (at the time of opening) is "This method is available only on the view class."
However, there isn't anything about this decorator that is CBV specific, and it is located in the generic django.utils module.
I propose to change the exception message to some variant of "This method is available only on the class, not on instances."
(It came up in a pull request discussion with @timgraham - https://github.com/django/django/pull/2674#discussion_r15948247)