~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/adapters/bugchange.py

Undo rename. Again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
    'CVE_UNLINKED',
17
17
    'MARKED_AS_DUPLICATE',
18
18
    'REMOVED_DUPLICATE_MARKER',
19
 
    'REMOVED_SUBSCRIBER',
20
19
    'BranchLinkedToBug',
21
20
    'BranchUnlinkedFromBug',
22
21
    'BugAttachmentChange',
73
72
CVE_UNLINKED = 'cve unlinked'
74
73
MARKED_AS_DUPLICATE = 'marked as duplicate'
75
74
REMOVED_DUPLICATE_MARKER = 'removed duplicate marker'
76
 
REMOVED_SUBSCRIBER = 'removed subscriber'
77
75
 
78
76
 
79
77
class NoBugChangeFoundError(Exception):
181
179
class UnsubscribedFromBug(BugChangeBase):
182
180
    """A user got unsubscribed from a bug."""
183
181
 
184
 
    def __init__(self, when, person, unsubscribed_user, **kwargs):
 
182
    def __init__(self, when, person, unsubscribed_user):
185
183
        super(UnsubscribedFromBug, self).__init__(when, person)
186
184
        self.unsubscribed_user = unsubscribed_user
187
 
        self.send_notification = kwargs.get('send_notification', False)
188
 
        self.notification_text = kwargs.get('notification_text')
189
185
 
190
186
    def getBugActivity(self):
191
187
        """See `IBugChange`."""
192
188
        return dict(
193
 
            whatchanged='%s %s' % (
194
 
                REMOVED_SUBSCRIBER,
 
189
            whatchanged='removed subscriber %s' % (
195
190
                self.unsubscribed_user.displayname))
196
191
 
197
192
    def getBugNotification(self):
198
193
        """See `IBugChange`."""
199
 
        if self.send_notification and self.notification_text:
200
 
            return {'text': '** %s' % self.notification_text}
201
 
        else:
202
 
            return None
 
194
        return None
203
195
 
204
196
 
205
197
class BugConvertedToQuestion(BugChangeBase):
630
622
                download_url_of_bugattachment(self.new_value))
631
623
        else:
632
624
            what_changed = ATTACHMENT_REMOVED
 
625
            attachment = self.new_value
633
626
            old_value = "%s %s" % (
634
627
                self.old_value.title,
635
628
                download_url_of_bugattachment(self.old_value))