diff options
author | bwarsaw <> | 2003-01-02 05:34:36 +0000 |
---|---|---|
committer | bwarsaw <> | 2003-01-02 05:34:36 +0000 |
commit | d2accceae5dd8df2ebad8c9472028f68f1a3eca9 (patch) | |
tree | 541d72e83e0c6fdb48e4ed5c13ed600fce6e1cec /Mailman/OldStyleMemberships.py | |
parent | a7abf5b2e9a5820a5971383942d12b2ac426bd3e (diff) | |
download | mailman2-d2accceae5dd8df2ebad8c9472028f68f1a3eca9.tar.gz mailman2-d2accceae5dd8df2ebad8c9472028f68f1a3eca9.tar.xz mailman2-d2accceae5dd8df2ebad8c9472028f68f1a3eca9.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.
Diffstat (limited to 'Mailman/OldStyleMemberships.py')
-rw-r--r-- | Mailman/OldStyleMemberships.py | 20 |
1 files changed, 10 insertions, 10 deletions
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() |