Merge remote-tracking branch 'origin/master'

This commit is contained in:
janphilippweinsheimer 2024-03-05 10:27:33 +01:00
commit d26b1a4ff8
2 changed files with 9 additions and 0 deletions

7
app.py
View File

@ -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",

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
pillow~=10.2.0
flask~=3.0.0