From 7cc72bf2d65dcd609539ac89ae8d19f55e37e1dd Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Thu, 9 Mar 2017 13:03:27 +0000 Subject: [PATCH] email: For direct sponsored uploads, email both the sponsor and sponsoree --- britney2/policies/email.py | 7 ++++++- tests/test_email.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/britney2/policies/email.py b/britney2/policies/email.py index 6fcf757..caaccc2 100644 --- a/britney2/policies/email.py +++ b/britney2/policies/email.py @@ -47,7 +47,12 @@ def person_chooser(source): source['sponsor_link'], source['creator_link'], } - {None} - BOTS - if source['package_signer_link'] in BOTS: + # some bots (e.g. bileto) generate uploads that are otherwise manual. We + # want to email the people that the bot was acting on behalf of. + bot = source['package_signer_link'] in BOTS + # direct uploads + regular = not source['creator_link'] and not source['sponsor_link'] + if bot or regular: people.add(source['package_creator_link']) return people diff --git a/tests/test_email.py b/tests/test_email.py index a9ae1a3..fa398e4 100755 --- a/tests/test_email.py +++ b/tests/test_email.py @@ -127,6 +127,7 @@ class T(unittest.TestCase): }) self.assertEqual(person_chooser(SPONSORED_UPLOAD), { 'https://api.launchpad.net/1.0/~apw', + 'https://api.launchpad.net/1.0/~smb' }) self.assertEqual(person_chooser(BILETO), { 'https://api.launchpad.net/1.0/~dobey',