forked from p15670423/monkey
Island: Use HTTPStatus in `api/island/mode` resource
This commit is contained in:
parent
1b562e723f
commit
b69b0468c5
|
@ -26,14 +26,11 @@ class IslandMode(AbstractResource):
|
||||||
|
|
||||||
self._island_mode_service.set_mode(mode)
|
self._island_mode_service.set_mode(mode)
|
||||||
|
|
||||||
# TODO: Do any of these returns need a body and make_response? What happens if we just
|
return {}, HTTPStatus.NO_CONTENT
|
||||||
# return the response code?
|
|
||||||
# API Spec: This should be 204 (NO CONTENT)
|
|
||||||
return make_response({}, HTTPStatus.NO_CONTENT)
|
|
||||||
except (AttributeError, json.decoder.JSONDecodeError):
|
except (AttributeError, json.decoder.JSONDecodeError):
|
||||||
return make_response({}, HTTPStatus.BAD_REQUEST)
|
return {}, HTTPStatus.BAD_REQUEST
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return make_response({}, HTTPStatus.UNPROCESSABLE_ENTITY)
|
return {}, HTTPStatus.UNPROCESSABLE_ENTITY
|
||||||
|
|
||||||
@jwt_required
|
@jwt_required
|
||||||
def get(self):
|
def get(self):
|
||||||
|
|
Loading…
Reference in New Issue