[CMF-checkins] CVS: CMF/CMFCore - MemberDataTool.py:1.26.4.2
Tres Seaver
tseaver@zope.com
Fri, 9 May 2003 13:39:09 -0400
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv17432/CMFCore
Modified Files:
Tag: CMF-1_4-branch
MemberDataTool.py
Log Message:
- Make the getProperty bit acutually work; tested on local_role_form,
as we dont' have unit tests (except interface conformance) for the tool
at all.
=== CMF/CMFCore/MemberDataTool.py 1.26.4.1 => 1.26.4.2 ===
--- CMF/CMFCore/MemberDataTool.py:1.26.4.1 Fri May 9 12:13:28 2003
+++ CMF/CMFCore/MemberDataTool.py Fri May 9 13:39:08 2003
@@ -113,17 +113,22 @@
if search_param == 'username':
search_param = 'id'
- for user_wrapper in self._members.values():
+ mtool = getToolByName(self, 'portal_membership')
- memberProperty = user_wrapper.getProperty
- searched = memberProperty( search_param, None )
+ for member_id in self._members.keys():
- if searched is not None and searched.find(search_term) != -1:
+ user_wrapper = mtool.getMemberById( member_id )
- res.append( { 'username': memberProperty( 'id' )
- , 'email' : memberProperty( 'email', '' )
- }
- )
+ if user_wrapper is not None:
+ memberProperty = user_wrapper.getProperty
+ searched = memberProperty( search_param, None )
+
+ if searched is not None and searched.find(search_term) != -1:
+
+ res.append( { 'username': memberProperty( 'id' )
+ , 'email' : memberProperty( 'email', '' )
+ }
+ )
return res
security.declarePrivate('pruneMemberDataContents')