Skip to content

Commit

Permalink
Updated wording
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinRiese committed Dec 11, 2024
1 parent 322936b commit 0353436
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion corehq/apps/sms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ class MessagingEvent(models.Model, MessagingStatusMixin):
ERROR_FCM_NO_ACTION = "FCM_NO_ACTION"
ERROR_FCM_NOTIFICATION_FAILURE = "FCM_NOTIFICATION_FAILURE"
ERROR_FCM_DOMAIN_NOT_ENABLED = 'FCM_DOMAIN_NOT_ENABLED'
ERROR_FILTER_MISMATCH = 'FILTER_MISMATCH'
FILTER_MISMATCH = 'FILTER_MISMATCH'

ERROR_MESSAGES = {
ERROR_NO_RECIPIENT:
Expand Down
6 changes: 3 additions & 3 deletions corehq/messaging/scheduling/scheduling_partitioned/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ def _passes_user_data_filter(self, contact):

if actual_values_set.isdisjoint(allowed_values_set):
return False, (f"Filtered out on property {key}: "
f"exp: ({','.join(allowed_values_set)}), "
f"act: ({','.join(actual_values_set)})")
f"allowed: ({','.join(allowed_values_set)}), "
f"found: ({','.join(actual_values_set)})")

return True, ""

Expand Down Expand Up @@ -344,7 +344,7 @@ def log_filtered_recipient(filtered_recipient, reason):
filtered_recipient,
content,
)
sub_event.error(MessagingEvent.ERROR_FILTER_MISMATCH, reason)
sub_event.error(MessagingEvent.FILTER_MISMATCH, reason)

recipient_count = 0
for recipient in self.expand_recipients(log_filtered_recipient):
Expand Down
6 changes: 3 additions & 3 deletions corehq/messaging/scheduling/tests/test_recipients.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_fails_with_user_data_filter_because_value_does_not_match(self):
passed, msg = (ScheduleInstance(domain=self.domain, schedule=schedule).
_passes_user_data_filter(self.mobile_user))
self.assertFalse(passed)
self.assertEqual(msg, "Filtered out on property wants_email: exp: (no), act: (yes)")
self.assertEqual(msg, "Filtered out on property wants_email: allowed: (no), found: (yes)")

def test_fails_with_user_data_filter_because_one_value_does_not_match(self):
schedule = AlertSchedule()
Expand All @@ -129,7 +129,7 @@ def test_fails_with_user_data_filter_because_one_value_does_not_match(self):
passed, msg = (ScheduleInstance(domain=self.domain, schedule=schedule).
_passes_user_data_filter(self.mobile_user))
self.assertFalse(passed)
self.assertEqual(msg, "Filtered out on property color: exp: (red), act: (green)")
self.assertEqual(msg, "Filtered out on property color: allowed: (red), found: (green)")

def test_passes_with_user_case_filter(self):
case = create_case_2(self.domain, case_type="thing", case_json={"case_color": "green"})
Expand Down Expand Up @@ -706,7 +706,7 @@ def handle_filtered_recipient(_, msg):
self.user_ids(instance.expand_recipients(handle_filtered_recipient)),
[self.mobile_user4.get_id, self.mobile_user5.get_id, self.mobile_user6.get_id]
)
self.assertEqual(message, "Filtered out on property role: exp: (nurse), act: (pharmacist)")
self.assertEqual(message, "Filtered out on property role: allowed: (nurse), found: (pharmacist)")
self.assertEqual(2, filtered_count)

def test_web_user_recipient_with_user_data_filter(self):
Expand Down

0 comments on commit 0353436

Please sign in to comment.