-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Closed
Copy link
Labels
Description
This issue is a side effect of the Permissions classes:
- DjangoModelPermissions https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/permissions.py#L111
- DjangoObjectPermissions https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/permissions.py#L172
The permission code is called in the initial()
method https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/views.py#L471 , just before the request method validation https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/views.py#L474
Steps to reproduce
Enable rest_framework.permissions.DjangoModelPermissions
on a ViewSet and submit any Method Not Allowed
, one that is not in that dict: https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/permissions.py#L90
Expected behavior
A proper "405 Method Not Allowed" as returned by https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/views.py#L474
Actual behavior
"500 Internal Server Error"
kevin-brown