Change exception message for django.utils.decorators.classonlymethod
|Reported by:||zsoldosp||Owned by:||timgraham|
|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)
Change History (2)
comment:1 Changed 8 months ago by timgraham
- Component changed from Uncategorized to Utilities
- Needs documentation unset
- Needs tests unset
- Owner changed from nobody to timgraham
- Patch needs improvement unset
- Status changed from new to assigned
- Triage Stage changed from Unreviewed to Accepted