diff options
author | bwarsaw <> | 2003-11-25 02:09:40 +0000 |
---|---|---|
committer | bwarsaw <> | 2003-11-25 02:09:40 +0000 |
commit | 772c365ea081e730ffaf398aceb950df8688bd72 (patch) | |
tree | 7256090da649c011ca312df95931e89dd42accff | |
parent | 678851304e8976c45ffec61d49d77316fd9d9b70 (diff) | |
download | mailman2-772c365ea081e730ffaf398aceb950df8688bd72.tar.gz mailman2-772c365ea081e730ffaf398aceb950df8688bd72.tar.xz mailman2-772c365ea081e730ffaf398aceb950df8688bd72.zip |
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.
-rw-r--r-- | Mailman/MailList.py | 14 |
1 files 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() |