예제 #1
0
 def apply_to(self, dialog_state: DialogState) -> None:
     dialog_state.drill_instance_id = None
     dialog_state.current_prompt_state = None
     dialog_state.current_drill = None
     dialog_state.user_profile.validated = True
     dialog_state.user_profile.is_demo = self.code_validation_payload.is_demo
     dialog_state.user_profile.account_info = self.code_validation_payload.account_info
예제 #2
0
 def apply_to(self, dialog_state: DialogState) -> None:
     # TODO: revisit this (pretty unfortunate) updating logic. Maybe we should always just
     # overwrite the dialog engine user profile data from scadmin, rather than having two
     # sources of truth?
     account_info = dialog_state.user_profile.account_info
     if "account_info" in self.user_profile_data:
         account_info = (account_info.copy(
             update=self.user_profile_data["account_info"])
                         if account_info else AccountInfo(
                             **self.user_profile_data["account_info"]))
     dialog_state.user_profile = dialog_state.user_profile.copy(
         update=self.user_profile_data)
     dialog_state.user_profile.account_info = account_info
     if self.purge_drill_state:
         dialog_state.current_drill = None
         dialog_state.drill_instance_id = None
         dialog_state.current_prompt_state = None
예제 #3
0
 def apply_to(self, dialog_state: DialogState) -> None:
     dialog_state.current_drill = self.drill
     dialog_state.drill_instance_id = self.drill_instance_id
     dialog_state.current_prompt_state = PromptState(
         slug=self.first_prompt.slug, start_time=self.created_time)
예제 #4
0
 def apply_to(self, dialog_state: DialogState) -> None:
     dialog_state.current_drill = None
     dialog_state.drill_instance_id = None
     dialog_state.current_prompt_state = None
     dialog_state.user_profile.opted_out = False
예제 #5
0
 def apply_to(self, dialog_state: DialogState) -> None:
     dialog_state.current_drill = None
     dialog_state.drill_instance_id = None
     dialog_state.current_prompt_state = None