aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbwarsaw <>2003-01-02 05:28:48 +0000
committerbwarsaw <>2003-01-02 05:28:48 +0000
commitce086f45b683bd1640e59fd511fc5ec704b25e5c (patch)
tree62a123933f96af9e7834d422471661afcf8093f1
parentab7f12012120fc2cf4b648803ef36ec6c5853d72 (diff)
downloadmailman2-ce086f45b683bd1640e59fd511fc5ec704b25e5c.tar.gz
mailman2-ce086f45b683bd1640e59fd511fc5ec704b25e5c.tar.xz
mailman2-ce086f45b683bd1640e59fd511fc5ec704b25e5c.zip
ChangeMemberAddress(): Don't raise MMAlreadyAMember if we're doing a
global change. ApprovedChangeMemberAddress(): Don't worry about trying to reduce the amount of work by testing on isMember(). This doesn't work anyway when we're changing an address for case only. Just do the changeMemberAddress() call and be done with it. Same goes for when deciding whether to do the change in the other lists.
-rw-r--r--Mailman/MailList.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index 8cffef8c..335a7d71 100644
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -971,8 +971,8 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
Utils.ValidateEmail(newaddr)
# Raise an exception if this email address is already a member of the
# list, but only if the new address is the same case-wise as the old
- # address.
- if newaddr == oldaddr and self.isMember(newaddr):
+ # address and we're not doing a global change.
+ if not globally and newaddr == oldaddr and self.isMember(newaddr):
raise Errors.MMAlreadyAMember
if newaddr == self.GetListEmail().lower():
raise Errors.MMBadEmailError
@@ -1010,14 +1010,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
msg.send(self)
def ApprovedChangeMemberAddress(self, oldaddr, newaddr, globally):
- # Change the membership for the current list first. We don't lock and
- # save ourself since we assume that the list is already locked.
- if self.isMember(newaddr):
- # Just delete the old address
- if self.isMember(oldaddr):
- self.ApprovedDeleteMember(oldaddr, admin_notif=1, userack=1)
- else:
- self.changeMemberAddress(oldaddr, newaddr)
+ self.changeMemberAddress(oldaddr, newaddr)
# If globally is true, then we also include every list for which
# oldaddr is a member.
if not globally:
@@ -1029,8 +1022,6 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
mlist = MailList(listname, lock=0)
if mlist.host_name <> self.host_name:
continue
- if not mlist.isMember(oldaddr) or mlist.isMember(newaddr):
- continue
mlist.Lock()
try:
mlist.changeMemberAddress(oldaddr, newaddr)