diff --git a/monkey/monkey_island/cc/resources/island_mode.py b/monkey/monkey_island/cc/resources/island_mode.py index 889b25a26..dd51d9fdb 100644 --- a/monkey/monkey_island/cc/resources/island_mode.py +++ b/monkey/monkey_island/cc/resources/island_mode.py @@ -21,4 +21,4 @@ class IslandMode(flask_restful.Resource): set_mode(mode) return make_response({}, 200) except ValueError: - return make_response({}, 404) + return make_response({}, 422) diff --git a/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py b/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py index 5c4362c64..91c6d0435 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py +++ b/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py @@ -21,7 +21,7 @@ def test_island_mode_post__invalid_mode(flask_client): resp = flask_client.post( "/api/island-mode", data=json.dumps({"mode": "bogus mode"}), follow_redirects=True ) - assert resp.status_code == 404 + assert resp.status_code == 422 def test_island_mode_post__set_model(flask_client, uses_database):