fix: removed cohorts filter from reported notifications (#34369)

This commit is contained in:
Ahtisham Shahid
2024-03-21 15:44:49 +05:00
committed by GitHub
parent 79f6223f69
commit 09cb944801
3 changed files with 5 additions and 4 deletions

View File

@@ -306,10 +306,9 @@ class DiscussionNotificationSender:
'content_type': content_type,
'content': thread_body
}
audience_filters = self._create_cohort_course_audience()
audience_filters['discussion_roles'] = [
audience_filters = {'discussion_roles': [
FORUM_ROLE_ADMINISTRATOR, FORUM_ROLE_MODERATOR, FORUM_ROLE_COMMUNITY_TA
]
]}
self._send_course_wide_notification("content_reported", audience_filters, context)

View File

@@ -54,6 +54,8 @@ class TestDiscussionNotificationSender(unittest.TestCase):
self.assertEqual(audience_filters, {
'discussion_roles': ['Administrator', 'Moderator', 'Community TA']
})
self.assertEqual(len(audience_filters), 1)
self.assertEqual(list(audience_filters.keys()), ['discussion_roles'])
def test_send_reported_content_notification_for_response(self, mock_send_notification, mock_create_audience):
"""

View File

@@ -563,7 +563,7 @@ class TestResponseEndorsedNotifications(DiscussionAPIViewTestMixin, ModuleStoreT
def test_response_endorsed_notifications(self):
"""
Tests nresponse endorsed notifications
Tests response endorsed notifications
"""
thread = ThreadMock(thread_id=1, creator=self.user_1, title='test thread')