From 0d49e97fe5bf347002a690298df87a9af55d98bf Mon Sep 17 00:00:00 2001 From: lucasheld Date: Sat, 12 Aug 2023 18:20:59 +0200 Subject: [PATCH] fix: validate accepted status codes types closes #42 --- uptime_kuma_api/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uptime_kuma_api/api.py b/uptime_kuma_api/api.py index 71f674c..6070e93 100644 --- a/uptime_kuma_api/api.py +++ b/uptime_kuma_api/api.py @@ -304,6 +304,9 @@ def _check_arguments_monitor(kwargs) -> None: ) _check_argument_conditions(conditions, kwargs) + if kwargs["accepted_statuscodes"] and not all([type(i) == str for i in kwargs["accepted_statuscodes"]]): + raise TypeError("Accepted status codes are not all strings") + def _check_arguments_notification(kwargs) -> None: required_args = ["type", "name"]