fix email address'mailto view stable cubicweb-version-3_3_2
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 25 Jun 2009 08:26:25 +0200
branchstable
changeset 2164 e3aeb6e6c3bb
parent 2163 f12373e04961
child 2165 dd40c375044e
child 2166 bef5e74e53f9
child 2188 3a57c8173290
fix email address'mailto view
web/views/emailaddress.py
--- a/web/views/emailaddress.py	Thu Jun 25 07:58:45 2009 +0200
+++ b/web/views/emailaddress.py	Thu Jun 25 08:26:25 2009 +0200
@@ -99,18 +99,17 @@
         if entity.reverse_primary_email:
             self.w(u'<b>')
         if entity.alias:
-            mailto = u'%s <%s>' % (entity.alias, entity.display_address())
+            alias = entity.alias
         elif entity.reverse_use_email:
-            mailto = "mailto:%s <%s>" % \
-                (entity.reverse_use_email[0].dc_title(),
-                 entity.display_address())
+            alias = entity.reverse_use_email[0].dc_title()
+        else:
+            alias = None
+        if alias:
+            mailto = "mailto:%s <%s>" % (alias, entity.display_address())
         else:
             mailto = "mailto:%s" % entity.display_address()
         self.w(u'<a href="%s">%s</a>' % (html_escape(mailto),
                                          html_escape(entity.display_address())))
-
-        if entity.alias:
-            self.w(u'&gt;\n')
         if entity.reverse_primary_email:
             self.w(u'</b>')