Use HTTP_BAD_REQUEST constant (#33797)
This commit is contained in:
parent
d510384c0d
commit
4c38e6cfa5
24 changed files with 111 additions and 61 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue