diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index de10d6930..993571b2b 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -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)