[Mailman-Developers] Problem with Moderate.py

Mark Sapiro mark at msapiro.net
Tue Sep 29 00:30:14 CEST 2009


C Nulk wrote:
>
>I am posting the matches_p function below.  I believe the problem is an
>off-shoot of the lce/cpe problem with the LDAPMembership adapter you
>helped me with earlier.  I did get it to work by changing the condition
>in matches_p from
>
>     if mother.members.has_key(sender):
>to
>    if mother.isMember(sender):


The change you made is correct. The problem is I think I referred you
to the original listinclusion.patch from
<http://sourceforge.net/tracker/index.php?func=detail&aid=1220144&group_id=103&atid=300103>,
and that patch has problems when the MemberAdaptor is other than the
default OldStyleMemberships.py.

The current Moderate.matches_p() is attached as matches_p.txt for your
reference.


[...]
>Is the change I made the correct way of fixing the problem?  If so,
>should other places where 'mlist.members.has_key(variable)' also be changed?


I don't know where else you are seeing mlist.members.has_key(variable),
but the only place anything like that should be referenced is in
OldStyleMemberships.py. Anywhere in the code at large where there is a
membership test it should be via the list's isMember() method which
will determine membership via the appropriate MemberAdaptor.


>I have also added the 'accept_special_posters' attribute I mentioned on
>the Mailman-users list.  Can you take at least a quick look at the
>changes to make sure I didn't mess things up to bad?  I have the diffs
>for MailList.py, versions.py, Version.py, Gui/Privacy.py and
>Handler/Moderate.py.


Yes, I can look at them.

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: matches_p.txt
URL: <http://mail.python.org/pipermail/mailman-developers/attachments/20090928/b2e29fd7/attachment.txt>


More information about the Mailman-Developers mailing list