[notification] can't see valid reason for this... 3.5
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 08 Sep 2009 15:30:49 +0200
branch3.5
changeset 3111 7b405bb305ab
parent 3110 757d36162235
child 3119 819aea456251
[notification] can't see valid reason for this...
__init__.py
--- a/__init__.py	Tue Sep 08 15:30:14 2009 +0200
+++ b/__init__.py	Tue Sep 08 15:30:49 2009 +0200
@@ -212,18 +212,9 @@
             userinfo['email'] = ""
             return userinfo
         user = self.actual_session().user
-        rql = "Any F,S,A where U eid %(x)s, U firstname F, U surname S, U primary_email E, E address A"
-        try:
-            firstname, lastname, email = self.execute(rql, {'x': user.eid}, 'x')[0]
-            if firstname is None and lastname is None:
-                userinfo['name'] = ''
-            else:
-                userinfo['name'] = ("%s %s" % (firstname, lastname))
-            userinfo['email'] = email
-        except IndexError:
-            userinfo['name'] = None
-            userinfo['email'] = None
         userinfo['login'] = user.login
+        userinfo['name'] = user.name()
+        userinfo['email'] = user.get_email()
         return userinfo
 
     def is_internal_session(self):