Skip to content

Commit

Permalink
Shorten message since it is redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinRiese committed Dec 12, 2024
1 parent ade57da commit d319bdb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion corehq/apps/sms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ class MessagingEvent(models.Model, MessagingStatusMixin):
ERROR_FCM_NO_ACTION: gettext_noop("No action selected for the FCM Data message type."),
ERROR_FCM_NOTIFICATION_FAILURE: gettext_noop("Failure while sending FCM notifications to the devices."),
ERROR_FCM_DOMAIN_NOT_ENABLED: gettext_noop("Domain is not enabled for FCM Push Notifications"),
FILTER_MISMATCH: gettext_noop("Recipient did not match filters")
FILTER_MISMATCH: gettext_noop("Recipient did not match filters:")
}

domain = models.CharField(max_length=126, null=False, db_index=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _passes_user_data_filter(self, contact):
actual_values_set = self.convert_to_set(user_data.get(key, ""))

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

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: allowed: (no), found: (yes)")
self.assertEqual(msg, "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: allowed: (red), found: (green)")
self.assertEqual(msg, "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: allowed: (nurse), found: (pharmacist)")
self.assertEqual(message, "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 d319bdb

Please sign in to comment.