Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c6dc48dd52
8
app.py
8
app.py
@ -177,6 +177,14 @@ def habit_create():
|
||||
except ValueError:
|
||||
errors['times'] = 'Die Anzahl muss eine Zahl sein.'
|
||||
|
||||
# Check that times is greater than 0
|
||||
if times <= 0:
|
||||
errors['times'] = 'Die Anzahl muss größer als 0 sein.'
|
||||
|
||||
# Check that unit is valid
|
||||
if unit not in ['Tag', 'Woche', 'Monat', 'Jahr']:
|
||||
errors['unit'] = 'Die Einheit ist ungültig.'
|
||||
|
||||
if errors:
|
||||
return render_template(
|
||||
'habit.html',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user