Whenever the browser sends an OPTIONS request, Django REST registers that as a PUT request.
I was writing my permission code when I noticed it. I use the default request parameter that is passed into the def has_object_permission( self, request, view, obj ):
.
Using request.method
will return the correct request method for every request except for OPTIONS.
However, when I use request.method
in a my get_permission( self, request, view ):
function in a different part of the project, correct response is returned. Could there be something wrong with the has_object_permission()
function?
Currently I just check if the request is PUT, as I believe PUT requests are not used by Django anyway. But it would be nice if I could use the actual name instead.
My Django REST version is 3.9.0