~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/model/bug.py

[r=sinzui][bug=865467] Updates subscription rules to avoid the
        situation where someone can see the bug but cannot see any bugtasks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1706
1706
 
1707
1707
        if private_changed or security_related_changed:
1708
1708
            changed_fields = []
 
1709
 
1709
1710
            if private_changed:
1710
1711
                changed_fields.append('private')
 
1712
                if not f_flag and private:
 
1713
                    # If we didn't call reconcileSubscribers, we may have
 
1714
                    # bug supervisors who should be on this bug, but aren't.
 
1715
                    supervisors = set()
 
1716
                    for bugtask in self.bugtasks:
 
1717
                        supervisors.add(bugtask.pillar.bug_supervisor)
 
1718
                    if None in supervisors:
 
1719
                        supervisors.remove(None)
 
1720
                    for s in supervisors:
 
1721
                        subscriptions = get_structural_subscriptions_for_bug(
 
1722
                                            self, s)
 
1723
                        if subscriptions != []:
 
1724
                            self.subscribe(s, who)
 
1725
 
1711
1726
            if security_related_changed:
1712
1727
                changed_fields.append('security_related')
1713
1728
                if not f_flag and security_related:
1718
1733
                    for pillar in self.affected_pillars:
1719
1734
                        if pillar.security_contact is not None:
1720
1735
                            self.subscribe(pillar.security_contact, who)
 
1736
 
1721
1737
            notify(ObjectModifiedEvent(
1722
1738
                    self, bug_before_modification, changed_fields, user=who))
1723
1739