From 772c365ea081e730ffaf398aceb950df8688bd72 Mon Sep 17 00:00:00 2001 From: bwarsaw <> Date: Tue, 25 Nov 2003 02:09:40 +0000 Subject: ApprovedChangeMemberAddress(): When someone requests to change their address globally, it is possible the new address is already a member of this (or one of the other) lists. In that case, the old address is removed. Closes SF # 835036. --- Mailman/MailList.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 475ef22a..143987c6 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -1041,7 +1041,13 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, msg.send(self) def ApprovedChangeMemberAddress(self, oldaddr, newaddr, globally): - self.changeMemberAddress(oldaddr, newaddr) + # It's possible they were a member of this list, but choose to change + # their membership globally. In that case, we simply remove the old + # address. + if self.isMember(newaddr): + self.removeMember(oldaddr) + else: + self.changeMemberAddress(oldaddr, newaddr) # If globally is true, then we also include every list for which # oldaddr is a member. if not globally: @@ -1057,7 +1063,11 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, continue mlist.Lock() try: - mlist.changeMemberAddress(oldaddr, newaddr) + # Same logic as above, re newaddr is already a member + if mlist.isMember(newaddr): + mlist.removeMember(oldaddr) + else: + mlist.changeMemberAddress(oldaddr, newaddr) mlist.Save() finally: mlist.Unlock() -- cgit v1.2.3