[CMF-checkins] CVS: CMF/CMFCore - MemberDataTool.py:1.30

Jens Vagelpohl jens@zope.com
Fri, 9 May 2003 13:46:11 -0400


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv18538/CMFCore

Modified Files:
	MemberDataTool.py 
Log Message:
- check more carefully for members whose user folder equivalent 
  has gone away



=== CMF/CMFCore/MemberDataTool.py 1.29 => 1.30 ===
--- CMF/CMFCore/MemberDataTool.py:1.29	Fri May  9 13:40:17 2003
+++ CMF/CMFCore/MemberDataTool.py	Fri May  9 13:46:10 2003
@@ -121,19 +121,23 @@
         if search_param == 'username':
             search_param = 'id'
 
-        for user_wrapper in self._members.values():
-            u = membership.getMemberById(user_wrapper.id)
-            searched = u.getProperty(search_param, None)
-            if searched is not None and searched.find(search_term) != -1:
-                user_data = {}
+        for user_id in self._members.keys():
+            u = membership.getMemberById(user_id)
 
-                for desired in attributes:
-                    if desired == 'id':
-                        user_data['username'] = u.getProperty(desired, '')
-                    else:
-                        user_data[desired] = u.getProperty(desired, '')
+            if u is not None:
+                memberProperty = u.getProperty
+                searched = memberProperty(search_param, None)
 
-                res.append(user_data)
+                if searched is not None and searched.find(search_term) != -1:
+                    user_data = {}
+
+                    for desired in attributes:
+                        if desired == 'id':
+                            user_data['username'] = memberProperty(desired, '')
+                        else:
+                            user_data[desired] = memberProperty(desired, '')
+
+                    res.append(user_data)
 
         return res