[CMF-checkins] CVS: CMF/CMFCollector/skins/collector - collector_edit_form.pt:1.3
Ken Manheimer
klm@zope.com
Thu, 18 Oct 2001 13:14:02 -0400
Update of /cvs-repository/CMF/CMFCollector/skins/collector
In directory cvs.zope.org:/tmp/cvs-serv6553
Modified Files:
collector_edit_form.pt
Log Message:
Go through contortions to try to get the administrators email address
in a robust way.
Just using 'member.getProperty()' isn't adequate - it seems to cause
an uncaught exception on new.zope.org, i don't know why. I can
imagine that users defined outside the portal membership won't have
getProperty, so for the interim:
- I'm conditioning invocation of getProperty on a hasattr of it
- I'm providing a fallback to trying the direct 'email' attribute if
getProperty is absent.
Maybe i should not do the latter, and the former should just be
working - or i'm using it wrong - will have to investigate when i
return. In the meanwhile, i want to see whether this at least works
around the problem on new.zope.org.
=== CMF/CMFCollector/skins/collector/collector_edit_form.pt 1.2 => 1.3 ===
</th>
<td colspan="2"
- tal:define="email python: getattr(here, 'email',
- getattr(member, 'email', ''))">
+ tal:define="getpropemail python: hasattr(member, 'getProperty')
+ and member.getProperty('email', '');
+ attremail python: getattr(member, 'email', '');
+ email python: getattr(here, 'email',
+ getpropemail or attremail)">
<input type="text" name="email" size=30
value="EMAIL"
tal:attributes="value email">