Skip to content

Commit a9a81af

Browse files
committed
make sure we don't double tap maintainers
if someone has a direct Role and a TeamRole we don't want to bother them twice
1 parent 3ce92f2 commit a9a81af

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

tests/unit/forklift/test_legacy.py

+2
Original file line numberDiff line numberDiff line change
@@ -3761,6 +3761,8 @@ def test_egg_upload_sends_pep_715_notice_org_roles(
37613761
)
37623762
team = TeamFactory.create(organization=org)
37633763
TeamRoleFactory.create(team=team, user=org_member)
3764+
# Duplicate the role directly on the project to ensure only one email
3765+
RoleFactory.create(user=org_member, project=project, role_name="Maintainer")
37643766
TeamProjectRoleFactory.create(project=project, team=team)
37653767

37663768
pyramid_config.testing_securitypolicy(identity=user)

warehouse/forklift/legacy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ def file_upload(request):
14831483
for teamrole in project.team_project_roles:
14841484
contributors += teamrole.team.members
14851485

1486-
for contributor in sorted(contributors):
1486+
for contributor in sorted(set(contributors)):
14871487
send_egg_uploads_deprecated_email(
14881488
request,
14891489
contributor,

warehouse/packaging/tasks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def send_pep_715_notices(request):
530530
for teamrole in project.team_project_roles:
531531
contributors += teamrole.team.members
532532

533-
for contributor in sorted(contributors):
533+
for contributor in sorted(set(contributors)):
534534
send_egg_uploads_deprecated_initial_email(
535535
request,
536536
contributor,

0 commit comments

Comments
 (0)