Skip to content

Commit

Permalink
Ensure one e-mail is notified only once (#1030)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpasternak committed Sep 1, 2022
1 parent 3b9d2a2 commit 4882fd4
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 4882fd4

Please sign in to comment.