Fixed type error

This commit is contained in:
Verox001 2024-01-23 10:46:52 +01:00
parent a33e349f63
commit f0f1b38eb0

4
app.py
View File

@ -176,12 +176,12 @@ def habit_create():
# Check if times is an integer
try:
times = int(times)
except ValueError:
errors['times'] = 'Die Anzahl muss eine Zahl sein.'
# Check that times is greater than 0
if times <= 0:
errors['times'] = 'Die Anzahl muss größer als 0 sein.'
except ValueError:
errors['times'] = 'Die Anzahl muss eine Zahl sein.'
# Check that unit is valid
if unit not in ['Tag', 'Woche', 'Monat', 'Jahr']: