Improve raised exception consistency for media source (#66497)
This commit is contained in:
parent
80394e3de6
commit
707f112f51
4 changed files with 21 additions and 6 deletions
|
@ -276,7 +276,7 @@ class UploadMediaView(HomeAssistantView):
|
|||
|
||||
uploaded_file: FileField = data["file"]
|
||||
|
||||
if not uploaded_file.content_type.startswith(("image/", "video/")):
|
||||
if not uploaded_file.content_type.startswith(("image/", "video/", "audio/")):
|
||||
LOGGER.error("Content type not allowed")
|
||||
raise vol.Invalid("Only images and video are allowed")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue