summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2003-01-02 05:38:31 +0000
committerbwarsaw2003-01-02 05:38:31 +0000
commit386aa3a3eece21702b5194d74bfa33a6096edb95 (patch)
treefa38ad2634a083a50958928b8244eb92f75c3055
parent5d8577096937b7649b4640daa014f647cfe55ed5 (diff)
downloadmailman-386aa3a3eece21702b5194d74bfa33a6096edb95.tar.gz
mailman-386aa3a3eece21702b5194d74bfa33a6096edb95.tar.zst
mailman-386aa3a3eece21702b5194d74bfa33a6096edb95.zip
changeMemberAddress(): Rearrange the order in which sub-tasks are
done. First remove the old member, then add the new member. Also fix the setting of user options so that this is done on the newaddress (lowercased). This should avoid MMAlreadyAMember errors when the address changes by case only.
-rw-r--r--Mailman/OldStyleMemberships.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Mailman/OldStyleMemberships.py b/Mailman/OldStyleMemberships.py
index cc42cb900..8ade3565e 100644
--- a/Mailman/OldStyleMemberships.py
+++ b/Mailman/OldStyleMemberships.py
@@ -1,17 +1,17 @@
-# Copyright (C) 2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-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
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""Old style Mailman membership adaptor.
@@ -211,7 +211,7 @@ class OldStyleMemberships(MemberAdaptor.MemberAdaptor):
# Set the member's default set of options
if self.__mlist.new_member_options:
self.__mlist.user_options[member] = self.__mlist.new_member_options
-
+
def removeMember(self, member):
assert self.__mlist.Locked()
self.__assertIsMember(member)
@@ -240,15 +240,15 @@ class OldStyleMemberships(MemberAdaptor.MemberAdaptor):
password = self.__mlist.passwords.get(memberkey,
Utils.MakeRandomPassword())
lang = self.getMemberLanguage(memberkey)
- # Add the new member
+ # First, possibly delete the old member
+ if not nodelete:
+ self.removeMember(memberkey)
+ # Now, add the new member
self.addNewMember(newaddress, realname=fullname, digest=digestsp,
password=password, language=lang)
# Set the entire options bitfield
if flags:
- self.__mlist.user_options[memberkey] = flags
- # Delete the old memberkey
- if not nodelete:
- self.removeMember(memberkey)
+ self.__mlist.user_options[newaddress.lower()] = flags
def setMemberPassword(self, memberkey, password):
assert self.__mlist.Locked()