From 7172dc62fe44cd41bf6d8b5c044ce5efd129db46 Mon Sep 17 00:00:00 2001 From: Bendik Christensen Date: Tue, 5 Dec 2023 16:01:26 +0100 Subject: [PATCH] fix --- scheduler/state_machine/controller.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scheduler/state_machine/controller.py b/scheduler/state_machine/controller.py index 9f11a50b..fea181e8 100644 --- a/scheduler/state_machine/controller.py +++ b/scheduler/state_machine/controller.py @@ -259,9 +259,8 @@ def check_if_end_date(self, date_to_check: date) -> bool: # the Goal Setting state starts on day 10 of the intervention if tracking_day is None: - logging.warning('Tracking day not found for user: ', user_id) - - if tracking_day is not None and tracking_day >= TRACKING_DURATION: + logging.warning('Tracking day not found for user: ', self.user_id) + elif tracking_day >= TRACKING_DURATION: self.set_new_state(GoalsSettingState(self.user_id)) return True @@ -415,8 +414,7 @@ def check_if_end_date(self, current_date: date): if quit_date is None: logging.warning('Quit date is not found for user ', self.user_id) - - if quit_date is not None and current_date >= quit_date: + elif quit_date is not None and current_date >= quit_date: logging.info('Goals setting state ended, starting execution state') # on the quit date, notify the user that today is the quit date @@ -474,8 +472,7 @@ def check_if_end_date(self, current_date: date): if quit_date is None: logging.warning('Quit date is not found for user ', self.user_id) - - if quit_date is not None and current_date >= quit_date: + elif current_date >= quit_date: logging.info('Buffer state ended, starting execution state') # on the quit date, notify the user that today is the quit date