~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/peoplemerge.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-30 09:17:36 UTC
  • mfrom: (13555.6.2 bug-761874)
  • Revision ID: launchpad@pqm.canonical.com-20110730091736-jjqwebomgxusdl3u
[r=wallyworld][bug=761874] Stop mailing ~registry on team deletes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
    dupe_person_emails = ()
97
97
    dupe_person = None
98
98
    target_person = None
 
99
    delete = False
99
100
 
100
101
    @property
101
102
    def cancel_url(self):
120
121
        """
121
122
        emailset = getUtility(IEmailAddressSet)
122
123
        self.dupe_person = data['dupe_person']
123
 
        self.target_person = data['target_person']
 
124
        self.target_person = data.get('target_person', None)
124
125
        self.dupe_person_emails = emailset.getByPerson(self.dupe_person)
125
126
 
126
127
    def doMerge(self, data):
140
141
                naked_email.accountID = self.target_person.accountID
141
142
                naked_email.status = EmailAddressStatus.NEW
142
143
        getUtility(IPersonSet).mergeAsync(
143
 
            self.dupe_person, self.target_person, reviewer=self.user)
 
144
            self.dupe_person, self.target_person, reviewer=self.user,
 
145
            delete=self.delete)
144
146
        self.request.response.addInfoNotification(self.merge_message)
145
147
        self.next_url = self.success_url
146
148
 
250
252
    """A view that deletes a team by merging it with Registry experts."""
251
253
 
252
254
    page_title = 'Delete'
253
 
    field_names = ['dupe_person', 'target_person']
 
255
    field_names = ['dupe_person']
254
256
    merge_message = _('The team is queued to be deleted.')
255
257
 
256
258
    @property
259
261
 
260
262
    def __init__(self, context, request):
261
263
        super(DeleteTeamView, self).__init__(context, request)
262
 
        if ('field.dupe_person' in self.request.form
263
 
            or 'field.target_person' in self.request.form):
 
264
        if ('field.dupe_person' in self.request.form):
264
265
            # These fields have fixed values and are managed by this method.
265
266
            # The user has crafted a request to gain ownership of the dupe
266
267
            # team's assets.
280
281
    def default_values(self):
281
282
        return {
282
283
            'field.dupe_person': self.context.name,
283
 
            'field.target_person': getUtility(
284
 
                ILaunchpadCelebrities).registry_experts.name,
 
284
            'field.delete': True,
285
285
            }
286
286
 
287
287
    @property
302
302
    @action('Delete', name='delete', condition=canDelete)
303
303
    def merge_action(self, action, data):
304
304
        base = super(DeleteTeamView, self)
 
305
        self.delete = True
305
306
        base.deactivate_members_and_merge_action.success(data)
306
307
 
307
308