Skip to content

ViewSet called on detail delete handler on an action matched url with no delete allowed #9146

Closed Answered by kevin-brown
mozartilize asked this question in Question & Answer
Discussion options

You must be logged in to vote

Are you saying the destroy method (if defined instead of delete on your viewset) is being triggered upon a DELETE to a custom detail endpoint?

Right now if you keep it as the delete method (which is not supported by DRF, that's not an expected ViewSet method) then that method will always be triggered for any DELETE requests on your ViewSet. That's actually why it's not supported or documented, since the expectation is that the destroy method will be defined instead.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@kevin-brown
Comment options

Answer selected by auvipy
@mozartilize
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #9144 on October 22, 2023 11:00.