Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendikchristensen committed Dec 5, 2023
1 parent 6cc7cdb commit 7172dc6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions scheduler/state_machine/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7172dc6

Please sign in to comment.