diff options
Diffstat (limited to 'djangorestframework/views.py')
| -rw-r--r-- | djangorestframework/views.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/djangorestframework/views.py b/djangorestframework/views.py index b0e23534..36d05721 100644 --- a/djangorestframework/views.py +++ b/djangorestframework/views.py @@ -147,10 +147,7 @@ class View(DjangoView): Return an HTTP 405 error if an operation is called which does not have a handler method. """ - content = { - 'detail': "Method '%s' not allowed." % request.method - } - raise ImmediateResponse(content, status.HTTP_405_METHOD_NOT_ALLOWED) + raise exceptions.MethodNotAllowed(request.method) @property def _parsed_media_types(self): |
