~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/mail/bugnotificationrecipients.py

  • Committer: Julian Edwards
  • Date: 2011-07-28 20:46:18 UTC
  • mfrom: (13553 devel)
  • mto: This revision was merged to the branch mainline in revision 13555.
  • Revision ID: julian.edwards@canonical.com-20110728204618-tivj2wx2oa9s32bx
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
from zope.interface import implements
12
12
 
13
 
from lp.services.mail.interfaces import INotificationRecipientSet
 
13
from canonical.launchpad.interfaces.launchpad import INotificationRecipientSet
14
14
from lp.services.mail.notificationrecipientset import NotificationRecipientSet
15
15
 
16
16
 
75
75
    def addDupeSubscriber(self, person, duplicate_bug=None):
76
76
        """Registers a subscriber of a duplicate of this bug."""
77
77
        reason = "Subscriber of Duplicate"
78
 
        if person.is_team:
 
78
        if person.isTeam():
79
79
            text = ("are a member of %s, which is subscribed "
80
80
                    "to a duplicate bug report" % person.displayname)
81
81
            reason += " @%s" % person.name
88
88
    def addDirectSubscriber(self, person):
89
89
        """Registers a direct subscriber of this bug."""
90
90
        reason = "Subscriber"
91
 
        if person.is_team:
 
91
        if person.isTeam():
92
92
            text = ("are a member of %s, which is subscribed "
93
93
                    "to the bug report" % person.displayname)
94
94
            reason += " @%s" % person.name
99
99
    def addAssignee(self, person):
100
100
        """Registers an assignee of a bugtask of this bug."""
101
101
        reason = "Assignee"
102
 
        if person.is_team:
 
102
        if person.isTeam():
103
103
            text = ("are a member of %s, which is a bug assignee"
104
104
                    % person.displayname)
105
105
            reason += " @%s" % person.name
107
107
            text = "are a bug assignee"
108
108
        self._addReason(person, text, reason)
109
109
 
110
 
    def addBugSupervisor(self, person):
111
 
        """Registers a bug supervisor of a bugtask's pillar of this bug."""
112
 
        reason = "Bug Supervisor"
113
 
        if person.is_team:
114
 
            text = ("are a member of %s, which is a bug supervisor"
115
 
                    % person.displayname)
116
 
            reason += " @%s" % person.name
117
 
        else:
118
 
            text = "are a bug supervisor"
119
 
        self._addReason(person, text, reason)
120
 
 
121
 
    def addSecurityContact(self, person):
122
 
        """Registers a security contact of a bugtask's pillar of this bug."""
123
 
        reason = "Security Contact"
124
 
        if person.is_team:
125
 
            text = ("are a member of %s, which is a security contact"
126
 
                    % person.displayname)
127
 
            reason += " @%s" % person.name
128
 
        else:
129
 
            text = "are a security contact"
130
 
        self._addReason(person, text, reason)
131
 
 
132
 
    def addMaintainer(self, person):
133
 
        """Registers a maintainer of a bugtask's pillar of this bug."""
134
 
        reason = "Maintainer"
135
 
        if person.is_team:
136
 
            text = ("are a member of %s, which is a maintainer"
137
 
                    % person.displayname)
138
 
            reason += " @%s" % person.name
139
 
        else:
140
 
            text = "are a maintainer"
141
 
        self._addReason(person, text, reason)
142
 
 
143
110
    def addStructuralSubscriber(self, person, target):
144
111
        """Registers a structural subscriber to this bug's target."""
145
112
        reason = "Subscriber (%s)" % target.displayname
146
 
        if person.is_team:
 
113
        if person.isTeam():
147
114
            text = ("are a member of %s, which is subscribed to %s" %
148
115
                (person.displayname, target.displayname))
149
116
            reason += " @%s" % person.name
154
121
    def addRegistrant(self, person, upstream):
155
122
        """Registers an upstream product registrant for this bug."""
156
123
        reason = "Registrant (%s)" % upstream.displayname
157
 
        if person.is_team:
 
124
        if person.isTeam():
158
125
            text = ("are a member of %s, which is the registrant for %s" %
159
126
                (person.displayname, upstream.displayname))
160
127
            reason += " @%s" % person.name