[CMF-checkins] CVS: CMF/CMFDefault - MembershipTool.py:1.43

Florent Guillaume fg at nuxeo.com
Tue Feb 10 15:07:58 EST 2004


Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv21599

Modified Files:
	MembershipTool.py 
Log Message:
Always use getattr to access the home folder as a subobject of the
members folder. This is more consistent and doesn't assume that the
members folder has item-based access.


=== CMF/CMFDefault/MembershipTool.py 1.42 => 1.43 ===
--- CMF/CMFDefault/MembershipTool.py:1.42	Sun Jan 11 07:59:01 2004
+++ CMF/CMFDefault/MembershipTool.py	Tue Feb 10 15:07:57 2004
@@ -276,12 +276,13 @@
         members = self.getMembersFolder()
         if members:
             try:
-                folder = members[id]
+                folder = getattr(members, id)
                 if verifyPermission and not _checkPermission(View, folder):
                     # Don't return the folder if the user can't get to it.
                     return None
                 return folder
-            except KeyError: pass
+            except AttributeError:
+                pass
         return None
 
     def getHomeUrl(self, id=None, verifyPermission=0):




More information about the CMF-checkins mailing list