diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-08-12 16:50:27 +0200 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-08-12 16:50:27 +0200 |
commit | 735a942b737bb5aab1f7f99b4415420a28a6ea69 (patch) | |
tree | 46cbdd80bed9042d598321ddbba67170abd75bb9 | |
parent | be8bb48b53217722171e1f60e18693e252cd066e (diff) |
handlers: Fix HTTP status code to 422.
Change-Id: I9ce925c643189aa832568950cdc68d14935af50b
-rw-r--r-- | app/handlers/base.py | 2 | ||||
-rw-r--r-- | app/handlers/tests/test_job_handler.py | 2 | ||||
-rw-r--r-- | app/handlers/tests/test_token_handler.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/app/handlers/base.py b/app/handlers/base.py index 6a8def2..3c94255 100644 --- a/app/handlers/base.py +++ b/app/handlers/base.py @@ -214,7 +214,7 @@ class BaseHandler(RequestHandler): except ValueError: error = "No JSON data found in the POST request" self.log.error(error) - response = HandlerResponse(420) + response = HandlerResponse(422) response.reason = error response.result = None else: diff --git a/app/handlers/tests/test_job_handler.py b/app/handlers/tests/test_job_handler.py index 59a4ce5..c8a60bd 100644 --- a/app/handlers/tests/test_job_handler.py +++ b/app/handlers/tests/test_job_handler.py @@ -155,7 +155,7 @@ class TestJobHandler(testing.AsyncHTTPTestCase, testing.LogTrapTestCase): '/api/job', method='POST', body='', headers=headers ) - self.assertEqual(response.code, 420) + self.assertEqual(response.code, 422) self.assertEqual( response.headers['Content-Type'], DEFAULT_CONTENT_TYPE) diff --git a/app/handlers/tests/test_token_handler.py b/app/handlers/tests/test_token_handler.py index 774c7a8..7794f07 100644 --- a/app/handlers/tests/test_token_handler.py +++ b/app/handlers/tests/test_token_handler.py @@ -138,7 +138,7 @@ class TestTokenHandler(testing.AsyncHTTPTestCase, testing.LogTrapTestCase): '/api/token', method='POST', body='', headers=headers ) - self.assertEqual(response.code, 420) + self.assertEqual(response.code, 422) self.assertEqual( response.headers['Content-Type'], DEFAULT_CONTENT_TYPE) |