Fixed habit times check
This commit is contained in:
parent
4e996180fe
commit
6282c374f7
7
app.py
7
app.py
@ -207,6 +207,10 @@ def habit_create():
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
errors['list_query'] = 'Die Anzahl muss eine Zahl sein.'
|
errors['list_query'] = 'Die Anzahl muss eine Zahl sein.'
|
||||||
|
|
||||||
|
# Check if unit is day and times is one
|
||||||
|
if unit == 'Tag' and times == 1:
|
||||||
|
errors['times'] = 'Die Anzahl muss größer als 1 sein, wenn das Habit täglich ist.'
|
||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
return render_template(
|
return render_template(
|
||||||
'habit.html',
|
'habit.html',
|
||||||
@ -378,6 +382,9 @@ def edit_habit_change():
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
errors['list_query'] = 'Die Anzahl muss eine Zahl sein.'
|
errors['list_query'] = 'Die Anzahl muss eine Zahl sein.'
|
||||||
|
|
||||||
|
if unit == 'Tag' and times == 1:
|
||||||
|
errors['times'] = 'Die Anzahl muss größer als 1 sein, wenn das Habit täglich ist.'
|
||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
return render_template(
|
return render_template(
|
||||||
"edit-habit.html",
|
"edit-habit.html",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user