Use HTTP_BAD_REQUEST constant (#33797)

This commit is contained in:
springstan 2020-04-09 21:43:42 +02:00 committed by GitHub
parent d510384c0d
commit 4c38e6cfa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 111 additions and 61 deletions

View file

@ -7,7 +7,7 @@ from aiohttp.web import Response, json_response
from nacl.encoding import Base64Encoder
from nacl.secret import SecretBox
from homeassistant.const import HTTP_OK
from homeassistant.const import HTTP_BAD_REQUEST, HTTP_OK
from homeassistant.core import Context
from homeassistant.helpers.json import JSONEncoder
from homeassistant.helpers.typing import HomeAssistantType
@ -99,7 +99,7 @@ def empty_okay_response(headers: Dict = None, status: int = HTTP_OK) -> Response
def error_response(
code: str, message: str, status: int = 400, headers: dict = None
code: str, message: str, status: int = HTTP_BAD_REQUEST, headers: dict = None
) -> Response:
"""Return an error Response."""
return json_response(