diff --git a/src/reputation/tasks.py b/src/reputation/tasks.py index 16310cf649..031b3b8144 100644 --- a/src/reputation/tasks.py +++ b/src/reputation/tasks.py @@ -443,6 +443,7 @@ def find_qualified_users_and_notify( notification_type=Notification.BOUNTY_FOR_YOU, extra={ "bounty_id": bounty.id, + "bounty_creator_id": bounty.created_by_id, "amount": bounty.amount, "bounty_type": bounty.bounty_type, "bounty_expiration_date": bounty.expiration_date, @@ -479,6 +480,7 @@ def find_bounties_for_user_and_notify(user_id) -> Notification | None: notification_type=Notification.BOUNTY_FOR_YOU, extra={ "bounty_id": bounty.id, + "bounty_creator_id": bounty.created_by_id, "amount": bounty.amount, "bounty_type": bounty.bounty_type, "bounty_expiration_date": bounty.expiration_date, diff --git a/src/researchhub_comment/tests/test_comments.py b/src/researchhub_comment/tests/test_comments.py index 3a6f356dbf..ff9f938709 100644 --- a/src/researchhub_comment/tests/test_comments.py +++ b/src/researchhub_comment/tests/test_comments.py @@ -394,6 +394,9 @@ def test_notify_qualified_users_about_bounty(self): ).last() self.assertEqual(notification.notification_type, Notification.BOUNTY_FOR_YOU) + self.assertEqual( + notification.extra["bounty_creator_id"], str(self.foundation.id) + ) def test_do_not_notify_unqualified_users_about_bounty(self):