[CMF-checkins] SVN: CMF/trunk/C "not members" is a bogus test to determine whether a members folder exists or

Chris McDonough chrism at plope.com
Fri Feb 16 14:27:26 EST 2007


Log message for revision 72651:
  "not members" is a bogus test to determine whether a members folder exists or
  not.  Change to "members is None".
  

Changed:
  U   CMF/trunk/CHANGES.txt
  U   CMF/trunk/CMFCore/MembershipTool.py
  U   CMF/trunk/CMFDefault/MembershipTool.py

-=-
Modified: CMF/trunk/CHANGES.txt
===================================================================
--- CMF/trunk/CHANGES.txt	2007-02-16 18:48:01 UTC (rev 72650)
+++ CMF/trunk/CHANGES.txt	2007-02-16 19:27:25 UTC (rev 72651)
@@ -17,6 +17,13 @@
       would take all user folders up to the Zope root into account whereas
       member area creation would not.
 
+    - CMFCore.MembershipTool/CMFDefault.MembershipTool: when using an
+      object without a __nonzero__ but with a __len__ (ala
+      CMFBTreeFolder) as a member folder, the createMemberArea method
+      would believe there was no members folder if the folder was
+      empty, and so would fail (change "not membersfolder" to
+      "membersfolder is not None") .
+
     - CMFDefault.File and CMFDefault.Image: Restored ZMI Cache tab which was
       lost in CMF 1.6.
 

Modified: CMF/trunk/CMFCore/MembershipTool.py
===================================================================
--- CMF/trunk/CMFCore/MembershipTool.py	2007-02-16 18:48:01 UTC (rev 72650)
+++ CMF/trunk/CMFCore/MembershipTool.py	2007-02-16 19:27:25 UTC (rev 72651)
@@ -242,7 +242,7 @@
         if not self.getMemberareaCreationFlag():
             return None
         members = self.getMembersFolder()
-        if not members:
+        if members is None:
             return None
         if self.isAnonymousUser():
             return None

Modified: CMF/trunk/CMFDefault/MembershipTool.py
===================================================================
--- CMF/trunk/CMFDefault/MembershipTool.py	2007-02-16 18:48:01 UTC (rev 72650)
+++ CMF/trunk/CMFDefault/MembershipTool.py	2007-02-16 19:27:25 UTC (rev 72651)
@@ -123,7 +123,7 @@
         if not self.getMemberareaCreationFlag():
             return None
         members = self.getMembersFolder()
-        if not members:
+        if members is None:
             return None
         if self.isAnonymousUser():
             return None



More information about the CMF-checkins mailing list