From d2accceae5dd8df2ebad8c9472028f68f1a3eca9 Mon Sep 17 00:00:00 2001 From: bwarsaw <> Date: Thu, 2 Jan 2003 05:34:36 +0000 Subject: 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. --- Mailman/OldStyleMemberships.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Mailman') diff --git a/Mailman/OldStyleMemberships.py b/Mailman/OldStyleMemberships.py index cc42cb90..8ade3565 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() -- cgit v1.2.3