diff --git a/app.py b/app.py index 087d361..e4a9fa7 100644 --- a/app.py +++ b/app.py @@ -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",