# HG changeset patch # User Sylvain Thénault # Date 1312455057 -7200 # Node ID db6d296cc66f4c5554e08112c4cb508be20a0454 # Parent 8767d03dab17e189273c4433a3e8ee9c7cf3ac23 [web] closes #1892494: emailaddress and anonymity notice though mangle-address is weak since address won't be mangled when fetched through rql diff -r 8767d03dab17 -r db6d296cc66f entities/lib.py --- a/entities/lib.py Thu Aug 04 12:50:55 2011 +0200 +++ b/entities/lib.py Thu Aug 04 12:50:57 2011 +0200 @@ -40,6 +40,7 @@ class EmailAddress(AnyEntity): __regid__ = 'EmailAddress' fetch_attrs, fetch_order = fetch_config(['address', 'alias']) + rest_attr = 'eid' def dc_title(self): if self.alias: diff -r 8767d03dab17 -r db6d296cc66f web/views/cwuser.py --- a/web/views/cwuser.py Thu Aug 04 12:50:55 2011 +0200 +++ b/web/views/cwuser.py Thu Aug 04 12:50:57 2011 +0200 @@ -168,6 +168,10 @@ class CWUserManagementView(StartupView): __regid__ = 'cw.user-management' + # XXX one could wish to display for instance only user's firstname/surname + # for non managers but filtering out NULL cause crash with an ldapuser + # source. + __select__ = match_user_groups('managers') rql = ('Any U,USN,F,S,U,UAA,UDS, L,UAA,UDSN ORDERBY L WHERE U is CWUser, ' 'U login L, U firstname F, U surname S, ' 'U in_state US, US name USN, ' diff -r 8767d03dab17 -r db6d296cc66f web/views/emailaddress.py --- a/web/views/emailaddress.py Thu Aug 04 12:50:55 2011 +0200 +++ b/web/views/emailaddress.py Thu Aug 04 12:50:57 2011 +0200 @@ -15,9 +15,8 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -"""Specific views for email addresses entities +"""Specific views for email addresses entities""" -""" __docformat__ = "restructuredtext en" from logilab.mtconverter import xml_escape @@ -85,8 +84,7 @@ class EmailAddressOneLineView(baseviews.OneLineView): __select__ = is_instance('EmailAddress') - def cell_call(self, row, col, **kwargs): - entity = self.cw_rset.get_entity(row, col) + def entity_call(self, entity, **kwargs): if entity.reverse_primary_email: self.w(u'') if entity.alias: @@ -106,8 +104,7 @@ __regid__ = 'mailto' __select__ = is_instance('EmailAddress') - def cell_call(self, row, col, **kwargs): - entity = self.cw_rset.get_entity(row, col) + def entity_call(self, entity, **kwargs): if entity.reverse_primary_email: self.w(u'') if entity.alias: @@ -130,7 +127,10 @@ __select__ = is_instance('EmailAddress') def cell_call(self, row, col, **kwargs): - self.wview('mailto', self.cw_rset, row=row, col=col, **kwargs) + if self._cw.vreg.config['mangle-emails']: + self.wview('oneline', self.cw_rset, row=row, col=col, **kwargs) + else: + self.wview('mailto', self.cw_rset, row=row, col=col, **kwargs) class EmailAddressTextView(baseviews.TextView):