Fixed type error
This commit is contained in:
parent
a33e349f63
commit
f0f1b38eb0
4
app.py
4
app.py
@ -176,12 +176,12 @@ def habit_create():
|
|||||||
# Check if times is an integer
|
# Check if times is an integer
|
||||||
try:
|
try:
|
||||||
times = int(times)
|
times = int(times)
|
||||||
except ValueError:
|
|
||||||
errors['times'] = 'Die Anzahl muss eine Zahl sein.'
|
|
||||||
|
|
||||||
# Check that times is greater than 0
|
# Check that times is greater than 0
|
||||||
if times <= 0:
|
if times <= 0:
|
||||||
errors['times'] = 'Die Anzahl muss größer als 0 sein.'
|
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
|
# Check that unit is valid
|
||||||
if unit not in ['Tag', 'Woche', 'Monat', 'Jahr']:
|
if unit not in ['Tag', 'Woche', 'Monat', 'Jahr']:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user