Fixed habit times check

This commit is contained in:
Verox001 2024-03-05 09:59:09 +01:00
parent 4e996180fe
commit 6282c374f7

7
app.py
View File

@ -207,6 +207,10 @@ def habit_create():
except ValueError:
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:
return render_template(
'habit.html',
@ -378,6 +382,9 @@ def edit_habit_change():
except ValueError:
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:
return render_template(
"edit-habit.html",