From f0f1b38eb0054abb65d4feb20a45ed4253fdfe9f Mon Sep 17 00:00:00 2001 From: Verox001 Date: Tue, 23 Jan 2024 10:46:52 +0100 Subject: [PATCH] Fixed type error --- app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 4fd3abb..e32abca 100644 --- a/app.py +++ b/app.py @@ -176,13 +176,13 @@ def habit_create(): # Check if times is an integer try: times = int(times) + + # Check that times is greater than 0 + if times <= 0: + errors['times'] = 'Die Anzahl muss größer als 0 sein.' 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.'