[CMF-checkins] CVS: CMF/CMFCollector - util.py:1.17
Ken Manheimer
klm@zope.com
Mon, 26 Aug 2002 10:59:46 -0400
Update of /cvs-repository/CMF/CMFCollector
In directory cvs.zope.org:/tmp/cvs-serv5972
Modified Files:
util.py
Log Message:
get_email_fullname(): Use defaulting user.getProperty() instead of
user.hasProperty()/user.getProperty() - because sometimes
hasProperty() returns false even when the getProperty() would return a
value... ! (I am assuming that getProperty() has the defaulting
behavior in all relevant versions of the member tool.)
=== CMF/CMFCollector/util.py 1.16 => 1.17 ===
--- CMF/CMFCollector/util.py:1.16 Mon Dec 24 11:50:04 2001
+++ CMF/CMFCollector/util.py Mon Aug 26 10:59:46 2002
@@ -56,14 +56,8 @@
mbrtool = getToolByName(self, 'portal_membership')
user = mbrtool.getMemberById(userid)
if user is not None:
- if not user.hasProperty('email'):
- return (None, None) # Not worth bothering.
- email = None
- name = userid
- email = user.getProperty('email')
- name = ((user.hasProperty('full_name')
- and user.getProperty('full_name'))
- or str(user))
+ email = user.getProperty('email', None)
+ name = user.getProperty('full_name', str(user))
if '.' in name or ',' in name:
name = '"%s"' % name
return (name, email)