This commit is contained in:
Rui Lima 2018-07-08 17:27:28 +00:00 committed by GitHub
commit a498933178
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,8 @@ class DestroyModelMixin(object):
"""
def destroy(self, request, *args, **kwargs):
instance = self.get_object()
if not instance:
return Response(status=status.HTTP_404_NOT_FOUND)
self.perform_destroy(instance)
return Response(status=status.HTTP_204_NO_CONTENT)