From 556d63b3344dd69875c18d074dcfa63a92396e4b Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Thu, 15 Aug 2002 14:49:20 +0000 Subject: membership_options(): Searching for a member should match against the full name too. --- Mailman/Cgi/admin.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index baeed7801..a1e375e14 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -31,7 +31,7 @@ import signal from types import * from string import lowercase, digits -from email.Utils import unquote, parseaddr +from email.Utils import unquote, parseaddr, formataddr from Mailman import mm_cfg from Mailman import Utils @@ -795,14 +795,17 @@ def membership_options(mlist, subcat, cgidata, doc, form): all = mlist.getMembers() all.sort(lambda x, y: cmp(x.lower(), y.lower())) # See if the query has a regular expression - regexp = cgidata.getvalue('findmember') + regexp = cgidata.getvalue('findmember', '').strip() if regexp: try: cre = re.compile(regexp, re.IGNORECASE) except re.error: doc.addError(_('Bad regular expression: ') + regexp) else: - all = [s for s in all if cre.search(s)] + # BAW: There's got to be a more efficient way of doing this! + names = [mlist.getMemberName(s) or '' for s in all] + all = [a for n, a in zip(names, all) + if cre.search(n) or cre.search(a)] chunkindex = None bucket = None actionurl = None -- cgit v1.2.3-70-g09d2