Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure one e-mail is notified only once #1030

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jazzband/projects/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def send_new_upload_notifications(project_id=None):
)
lead_members = [membership.user for membership in lead_memberships]

recipients = []
recipients = set()

for lead_member in lead_members + list(User.roadies()):

Expand All @@ -98,11 +98,11 @@ def send_new_upload_notifications(project_id=None):
if not primary_email:
continue

recipients.append(primary_email.email)
recipients.add(primary_email.email)

message = Message(
subject=f"Project {upload.project.name} received a new upload",
recipients=recipients,
recipients=list(recipients),
body=render_template(
"projects/mails/new_upload_notification.txt",
project=upload.project,
Expand Down