Merged in [19255] from rjsparks@nostrum.com:

Correct calculation of bofreq_responsible mailtrigger.Recipient to return no addresses for documents that are not of type bofreq.  Fixes #3358.
 - Legacy-Id: 19274
Note: SVN reference [19255] has been migrated to Git commit 83f1b6229e
This commit is contained in:
Robert Sparks 2021-08-04 21:38:14 +00:00
commit b41f5c4ca9

View file

@ -406,13 +406,14 @@ class Recipient(models.Model):
def gather_bofreq_responsible(self, **kwargs):
addrs = []
if 'doc' in kwargs:
bofreq = kwargs['doc']
responsible = bofreq_responsible(bofreq)
if responsible:
addrs.extend([leader.email_address() for leader in responsible])
else:
addrs.extend(Recipient.objects.get(slug='iab').gather(**{}))
addrs.extend(Recipient.objects.get(slug='iesg').gather(**{}))
doc = kwargs['doc']
if doc.type_id=='bofreq':
responsible = bofreq_responsible(doc)
if responsible:
addrs.extend([leader.email_address() for leader in responsible])
else:
addrs.extend(Recipient.objects.get(slug='iab').gather(**{}))
addrs.extend(Recipient.objects.get(slug='iesg').gather(**{}))
return addrs
def gather_bofreq_previous_responsible(self, **kwargs):