Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix validation #653

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions yal/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,30 +204,30 @@ async def process_message(self, message):
endline_survey_started = self.user.metadata.get("endline_survey_started")
endline_reminder = self.user.metadata.get("endline_reminder")

if endline_survey_started:
if (
keyword in EJAF_ENDLINE_SURVEY_KEYWORDS
and baseline_survey_completed
and not endline_survey_completed
):
self.save_metadata("assessment_reminder_sent", False)
self.save_metadata("assessment_reminder_name", "")
self.user.session_id = None

if (
keyword in EJAF_ENDLINE_SURVEY_KEYWORDS
and baseline_survey_completed
and not endline_survey_completed
):
self.save_metadata("assessment_reminder_sent", False)
self.save_metadata("assessment_reminder_name", "")

if keyword == "remind me tomorrow":
self.state_name = AssessmentApplication.REMINDER_STATE
elif keyword == "i m not interested":
if endline_reminder:
self.state_name = (
AssessmentApplication.REMINDER_NOT_INTERESTED_STATE
)
else:
self.state_name = EndlineTermsApplication.NO_CONSENT_STATE
if keyword == "remind me tomorrow":
self.state_name = AssessmentApplication.REMINDER_STATE
elif keyword == "i m not interested":
if endline_reminder:
self.state_name = (
AssessmentApplication.REMINDER_NOT_INTERESTED_STATE
)
else:
self.state_name = EndlineTermsApplication.START_STATE
self.state_name = EndlineTermsApplication.NO_CONSENT_STATE
else:
self.state_name = EndlineSurveyApplication.SURVEY_VALIDATION_STATE
self.state_name = EndlineTermsApplication.START_STATE

if endline_survey_started and keyword not in EJAF_ENDLINE_SURVEY_KEYWORDS:
self.user.session_id = None
self.state_name = EndlineSurveyApplication.SURVEY_VALIDATION_STATE

# Fields that RapidPro sets after a feedback push message
feedback_state = await self.get_feedback_state()
Expand Down
Loading