validate hours to not be greater than 23, #209

This commit is contained in:
simon 2022-04-07 23:02:07 +07:00
parent b1a7a6a148
commit 6a1cb15114
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -220,6 +220,10 @@ class ScheduleBuilder:
raise ValueError("invalid input")
to_write = dict(zip(keys, values))
all_hours = [int(i) for i in re.split(r"\D+", to_write["hour"])]
if max(all_hours) > 23:
print("hour can't be greater than 23")
raise ValueError("invalid input")
try:
int(to_write["minute"])
except ValueError as error: