3914
3914
naked_from_team.retractTeamMembership(team, reviewer)
3915
3915
IStore(from_team).flush()
3917
def mergeAsync(self, from_person, to_person, reviewer=None):
3917
def mergeAsync(self, from_person, to_person, reviewer=None, delete=False):
3918
3918
"""See `IPersonSet`."""
3919
3919
return getUtility(IPersonMergeJobSource).create(
3920
from_person=from_person, to_person=to_person, reviewer=reviewer)
3920
from_person=from_person, to_person=to_person, reviewer=reviewer,
3923
def delete(self, from_person, reviewer):
3924
"""See `IPersonSet`."""
3925
# Deletes are implemented by merging into registry experts. Force
3926
# the target to prevent any accidental misuse by calling code.
3927
to_person = getUtility(ILaunchpadCelebrities).registry_experts
3928
return self._merge(from_person, to_person, reviewer, True)
3922
3930
def merge(self, from_person, to_person, reviewer=None):
3923
3931
"""See `IPersonSet`."""
3932
return self._merge(from_person, to_person, reviewer)
3934
def _merge(self, from_person, to_person, reviewer, delete=False):
3935
"""Helper for merge and delete methods."""
3924
3936
# since we are doing direct SQL manipulation, make sure all
3925
3937
# changes have been flushed to the database
3926
3938
store = Store.of(from_person)
4154
4166
UPDATE OpenIdIdentifier SET account=%s WHERE account=%s
4155
4167
""" % sqlvalues(to_person.accountID, from_person.accountID))
4170
# We don't notify anyone about deletes.
4157
4173
# Inform the user of the merge changes.
4158
4174
if to_person.isTeam():
4159
4175
mail_text = get_email_template(