Skip to content

[ENG-11835] - Fix missing spam/ban notifications - #11866

Open
Vlad0n20 wants to merge 2 commits into
CenterForOpenScience:feature/pbs-26-15from
Vlad0n20:fix/ENG-11835
Open

[ENG-11835] - Fix missing spam/ban notifications#11866
Vlad0n20 wants to merge 2 commits into
CenterForOpenScience:feature/pbs-26-15from
Vlad0n20:fix/ENG-11835

Conversation

@Vlad0n20

@Vlad0n20 Vlad0n20 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Ticket

Purpose

Changes

Side Effects

QE Notes

CE Notes

Documentation

Comment thread osf/models/mixins.py
Comment on lines +2313 to +2332
if notify and not was_already_spam:
Preprint = apps.get_model('osf.Preprint')
notification_type = (
NotificationTypeEnum.PREPRINT_CONFIRMED_SPAM
if isinstance(self, Preprint)
else NotificationTypeEnum.NODE_CONFIRMED_SPAM
)
resource_type_label = 'preprint' if isinstance(self, Preprint) else 'project'
for contributor in self.contributors:
notification_type.instance.emit(
user=contributor,
subscribed_object=self,
event_context={
'user_fullname': contributor.fullname,
'resource_title': self.title,
'resource_absolute_url': self.absolute_url,
'resource_type_label': resource_type_label,
'osf_support_email': settings.OSF_SUPPORT_EMAIL,
}
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registrations inherit this mixin and will be labeled "project" and use NODE_CONFIRMED_SPAM. Should we use a registration-specific label/type?

@antkryt antkryt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants