diff --git a/lms/djangoapps/discussion/django_comment_client/base/tests.py b/lms/djangoapps/discussion/django_comment_client/base/tests.py index f8242efa0c..62af24f0ee 100644 --- a/lms/djangoapps/discussion/django_comment_client/base/tests.py +++ b/lms/djangoapps/discussion/django_comment_client/base/tests.py @@ -1458,6 +1458,8 @@ class CreateSubCommentUnicodeTestCase( @disable_signal(views, 'comment_created') @disable_signal(views, 'comment_voted') @disable_signal(views, 'comment_deleted') +@disable_signal(views, 'comment_flagged') +@disable_signal(views, 'thread_flagged') class TeamsPermissionsTestCase(ForumsEnableMixin, UrlResetMixin, SharedModuleStoreTestCase, MockRequestSetupMixin): # Most of the test points use the same ddt data. # args: user, commentable_id, status_code diff --git a/lms/djangoapps/discussion/rest_api/discussions_notifications.py b/lms/djangoapps/discussion/rest_api/discussions_notifications.py index 7249d086cc..21b1e27fcd 100644 --- a/lms/djangoapps/discussion/rest_api/discussions_notifications.py +++ b/lms/djangoapps/discussion/rest_api/discussions_notifications.py @@ -314,7 +314,7 @@ class DiscussionNotificationSender: content_type = thread_types[self.thread.type][getattr(self.thread, 'depth', 0)] context = { - 'username': self.creator.username, + 'username': self.thread.username, 'content_type': content_type, 'content': thread_body } diff --git a/lms/djangoapps/discussion/rest_api/tests/test_discussions_notifications.py b/lms/djangoapps/discussion/rest_api/tests/test_discussions_notifications.py index eeed292037..b4d3f3d18a 100644 --- a/lms/djangoapps/discussion/rest_api/tests/test_discussions_notifications.py +++ b/lms/djangoapps/discussion/rest_api/tests/test_discussions_notifications.py @@ -44,7 +44,7 @@ class TestDiscussionNotificationSender(unittest.TestCase): self.assertEqual(notification_type, "content_reported") self.assertEqual(context, { - 'username': 'test_user', + 'username': self.thread.username, 'content_type': expected_content_type, 'content': 'Thread body' })