email: For direct sponsored uploads, email both the sponsor and sponsoree

master
Iain Lane 7 years ago committed by Iain Lane
parent 5f4c2e735d
commit 7cc72bf2d6

@ -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

@ -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',

Loading…
Cancel
Save