diff options
| author | cotton | 1998-11-19 14:37:00 +0000 |
|---|---|---|
| committer | cotton | 1998-11-19 14:37:00 +0000 |
| commit | f585165cf15b5b62fc1c9dc37611f9e82a6badca (patch) | |
| tree | 2b6cbfc310df86edad6291b1191971a32ef89af0 /Mailman/MailList.py | |
| parent | 2160857b9fe3f92c30231e78e0a7dc2a05747e02 (diff) | |
| download | mailman-f585165cf15b5b62fc1c9dc37611f9e82a6badca.tar.gz mailman-f585165cf15b5b62fc1c9dc37611f9e82a6badca.tar.zst mailman-f585165cf15b5b62fc1c9dc37611f9e82a6badca.zip | |
whoops, just realized that there were a couple of places where i
didn't translate Utils.FindMatchingAddresses properly!
in MailList.Post(), FindMatchingAddresses was applied to list.posters
and list.forbidden_posters which are lists and not dicts, so I added a
function in Utils called List2Dict that takes a list and retuns a dict
keyed by the items in the list (it doesn't check for whether the items
are hashable). All values are 1.
This function is now used in MailList.Post(): where the
FindMatchingAddresses was applied to an address list, it is now
applied to Utils.List2Dict(address list).
scott
Diffstat (limited to 'Mailman/MailList.py')
| -rw-r--r-- | Mailman/MailList.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 68d57a807..5116b9e3a 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -141,8 +141,8 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, def FindUser(self, email): matches = Utils.FindMatchingAddresses(email, - (self.members, - self.digest_members)) + self.members, + self.digest_members) if not matches or not len(matches): return None return matches[0] @@ -944,8 +944,8 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, Errors.LOOPING_POST, msg.getheader('subject')) if len(self.forbidden_posters): - addrs = Utils.FindMatchingAddresses(sender, - self.forbidden_posters) + forbidden_posters = Utils.List2Dict(self.forbidden_posters) + addrs = Utils.FindMatchingAddresses(sender, forbidden_posters) if len(addrs): self.AddRequest('post', Utils.SnarfMessage(msg), Errors.FORBIDDEN_SENDER_MSG, @@ -955,7 +955,8 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, Errors.MODERATED_LIST_MSG, msg.getheader('subject')) elif self.moderated and len(self.posters): - addrs = Utils.FindMatchingAddresses(sender, self.posters) + addrs = Utils.FindMatchingAddresses(sender, + Utils.List2Dict(self.posters)) if not len(addrs): self.AddRequest('post', Utils.SnarfMessage(msg), Errors.MODERATED_LIST_MSG, @@ -964,7 +965,8 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, # not moderated # elif len(self.posters): - addrs = Utils.FindMatchingAddresses(sender, self.posters) + addrs = Utils.FindMatchingAddresses(sender, + Utils.List2Dict(self.posters)) if not len(addrs): if self.member_posting_only: if not self.IsMember(sender): |
