Skip to content

Commit

Permalink
Merge pull request #5215 from dimagi/add-reminder-type
Browse files Browse the repository at this point in the history
Add special reminder type for survey management
  • Loading branch information
millerdev committed Jan 6, 2015
2 parents fd4e767 + af293f1 commit df537af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion corehq/apps/reminders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ class IllegalModelStateException(Exception):
REMINDER_TYPE_ONE_TIME = "ONE_TIME"
REMINDER_TYPE_KEYWORD_INITIATED = "KEYWORD_INITIATED"
REMINDER_TYPE_DEFAULT = "DEFAULT"
REMINDER_TYPE_CHOICES = [REMINDER_TYPE_DEFAULT, REMINDER_TYPE_ONE_TIME, REMINDER_TYPE_KEYWORD_INITIATED]
REMINDER_TYPE_SURVEY_MANAGEMENT = "SURVEY_MANAGEMENT"
REMINDER_TYPE_CHOICES = [REMINDER_TYPE_DEFAULT, REMINDER_TYPE_ONE_TIME,
REMINDER_TYPE_KEYWORD_INITIATED, REMINDER_TYPE_SURVEY_MANAGEMENT]

SEND_NOW = "NOW"
SEND_LATER = "LATER"
Expand Down
3 changes: 3 additions & 0 deletions corehq/apps/reminders/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
QUESTION_RETRY_CHOICES,
REMINDER_TYPE_ONE_TIME,
REMINDER_TYPE_DEFAULT,
REMINDER_TYPE_SURVEY_MANAGEMENT,
SEND_NOW, SEND_LATER,
METHOD_SMS,
METHOD_SMS_SURVEY,
Expand Down Expand Up @@ -1286,6 +1287,7 @@ def add_survey(request, domain, survey_id=None):
sample_id = sample["sample_id"],
survey_incentive = sample["incentive"],
submit_partial_forms = True,
reminder_type=REMINDER_TYPE_SURVEY_MANAGEMENT,
)
handler.save()
wave.reminder_definitions[sample["sample_id"]] = handler._id
Expand Down Expand Up @@ -1388,6 +1390,7 @@ def add_survey(request, domain, survey_id=None):
sample_id = sample_id,
survey_incentive = sample_data[sample_id]["incentive"],
submit_partial_forms = True,
reminder_type=REMINDER_TYPE_SURVEY_MANAGEMENT,
)
handler.save()
wave.reminder_definitions[sample_id] = handler._id
Expand Down

0 comments on commit df537af

Please sign in to comment.