[CMF-checkins] CVS: Products/CMFCore - MembershipTool.py:1.50

Jens Vagelpohl jens at dataflake.org
Tue Mar 22 18:23:07 EST 2005


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv15342/CMFCore

Modified Files:
	MembershipTool.py 
Log Message:
- CMFCore.MembershipTool: Change a couple conditional tests that tried to
  determine if the MemberDataTool had been found to explicitly test for
  None as the return value instead of a truth test on the tool itself, which
  would fail unexpectedly on folderish MemberDataTool implementations
  that don't have actual content (http://www.zope.org/Collectors/CMF/330)


=== Products/CMFCore/MembershipTool.py 1.49 => 1.50 ===
--- Products/CMFCore/MembershipTool.py:1.49	Thu Aug 12 11:07:39 2004
+++ Products/CMFCore/MembershipTool.py	Tue Mar 22 18:23:06 2005
@@ -138,7 +138,7 @@
                     u.roles.append(portal_role)
 
         mdtool = getToolByName(self, 'portal_memberdata', None)
-        if mdtool:
+        if mdtool is not None:
             try:
                 u = mdtool.wrapUser(u)
             except ConflictError:
@@ -486,7 +486,7 @@
 
         # Delete member data in portal_memberdata.
         mdtool = getToolByName(self, 'portal_memberdata', None)
-        if mdtool:
+        if mdtool is not None:
             for member_id in member_ids:
                 mdtool.deleteMemberData(member_id)
 



More information about the CMF-checkins mailing list