return from _get_responses earlier when delete method

This commit is contained in:
Dima Knivets 2019-08-09 15:55:10 +03:00
parent e15177383c
commit 5de0ab498c

View File

@ -465,6 +465,13 @@ class AutoSchema(ViewInspector):
def _get_responses(self, path, method):
# TODO: Handle multiple codes and pagination classes.
if method == 'DELETE':
return {
'204': {
'description': ''
}
}
item_schema = {}
serializer = self._get_serializer(path, method)
@ -485,13 +492,6 @@ class AutoSchema(ViewInspector):
else:
response_schema = item_schema
if method == 'DELETE':
return {
'204': {
'description': ''
}
}
return {
'200': {
'content': {