|
3 | 3 | from datetime import date, datetime, timedelta |
4 | 4 | from state_machine.state_machine_utils import (create_new_date, get_dialog_completion_state, |
5 | 5 | get_execution_week, get_intervention_component, |
| 6 | + get_activity_completion_state, |
6 | 7 | get_all_scheduled_occurrence, |
7 | 8 | get_last_component_state, |
8 | 9 | get_next_planned_date, get_next_scheduled_occurrence, |
@@ -239,8 +240,9 @@ def on_new_day(self, current_date: date): |
239 | 240 |
|
240 | 241 | # at day 7 activity C2.9 has to be proposed |
241 | 242 | start_date = get_start_date(self.user_id) |
242 | | - ga_completed = get_dialog_completion_state(self.user_id, Components.GENERAL_ACTIVITY) |
243 | | - if (current_date - start_date).days >= ACTIVITY_C2_9_DAY_TRIGGER and not ga_completed: |
| 243 | + choose_sport_completed = get_activity_completion_state(self.user_id, 29) |
| 244 | + if ((current_date - start_date).days >= ACTIVITY_C2_9_DAY_TRIGGER |
| 245 | + and not choose_sport_completed): |
244 | 246 | plan_and_store(user_id=self.user_id, |
245 | 247 | dialog=Components.GENERAL_ACTIVITY, |
246 | 248 | phase_id=1) |
@@ -332,7 +334,7 @@ def plan_execution_start_dialog(self): |
332 | 334 | # this is the intro video to be sent the first time |
333 | 335 | # the execution starts (not after lapse/relapse) |
334 | 336 | quit_date = get_quit_date(self.user_id) |
335 | | - planned_date = create_new_date(start_date=quit_date) |
| 337 | + planned_date = create_new_date(start_date=quit_date, minute=5) |
336 | 338 |
|
337 | 339 | plan_and_store(user_id=self.user_id, |
338 | 340 | dialog=Components.EXECUTION_INTRODUCTION, |
|
0 commit comments