use request's content-type as response's if there's no content

This commit is contained in:
roboslone 2016-12-26 12:09:12 +03:00
parent 931b6cb7e0
commit 60585ac281

View File

@ -91,7 +91,7 @@ class DestroyModelMixin(object):
def destroy(self, request, *args, **kwargs):
instance = self.get_object()
self.perform_destroy(instance)
return Response(status=status.HTTP_204_NO_CONTENT)
return Response(status=status.HTTP_204_NO_CONTENT, content_type=request.content_type)
def perform_destroy(self, instance):
instance.delete()