Notifications: exclude system users (TM, sync, GT) from recipients#4174
Open
ayshushus wants to merge 2 commits into
Open
Notifications: exclude system users (TM, sync, GT) from recipients#4174ayshushus wants to merge 2 commits into
ayshushus wants to merge 2 commits into
Conversation
flodolo
reviewed
May 26, 2026
Collaborator
flodolo
left a comment
There was a problem hiding this comment.
Passing by thought, since I'm touching some of this code for another issue.
Instead of spreading the filter, have you considered using a helper function in pontoon/messaging/notifications.py to filter+send? e.g. something like
def send_notification(sender, recipient, **kwargs):
if recipient.profile.system_user:
return
notify.send(sender, recipient=recipient, **kwargs)I think we're filtering out system users before sending notifications in 4/5 places, and I don't see a scenario where we want to notify system users.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #3954
System users (
pontoon-sync,pontoon-gt,pontoon-tm) have translation/review activity attributed. HaveUserProfile.system_user=Truebut no callsite check.profile__system_user=Falsefilter to everynotify.send()recipient queryset:sync.core.notify_users(new strings)messaging.management.commands.send_deadline_notificationsmessaging.management.commands.send_review_notifications(filter onuser__profile__system_user)messaging.management.commands.send_suggestion_notificationstranslations.views.create_translation(new-contributor notification to locale managers)base.views._send_add_comment_notificationsand_send_pin_comment_notificationsmessaging.notifications.send_badge_notificationwhenuser.profile.system_user.messaging.views.get_recipientsreturn queryset.Add tests (@functionzz) in
pontoon/messaging/tests/test_send_notifications.pycovering all four commands, badge notification; newpontoon/sync/tests/test_notify_users.pycoveringsync.core.notify_users.