mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 03:40:14 +00:00
validate hours to not be greater than 23, #209
This commit is contained in:
parent
b1a7a6a148
commit
6a1cb15114
@ -220,6 +220,10 @@ class ScheduleBuilder:
|
|||||||
raise ValueError("invalid input")
|
raise ValueError("invalid input")
|
||||||
|
|
||||||
to_write = dict(zip(keys, values))
|
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:
|
try:
|
||||||
int(to_write["minute"])
|
int(to_write["minute"])
|
||||||
except ValueError as error:
|
except ValueError as error:
|
||||||
|
Loading…
Reference in New Issue
Block a user