Changeset - 7e3e9d0c5575
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2012-06-25 23:16:14
marcin@python-works.com
Add list of all emails that user may have into get_user call
3 files changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
docs/api/api.rst
Show inline comments
 
@@ -152,6 +152,7 @@ OUTPUT::
 
                "firstname": "<firstname>",
 
                "lastname" : "<lastname>",
 
                "email" :    "<email>",
 
                "emails":    "<list_of_all_additional_emails>",
 
                "active" :   "<bool>",
 
                "admin" :    "<bool>",
 
                "ldap_dn" :  "<ldap_dn>",
rhodecode/controllers/api/api.py
Show inline comments
 
@@ -97,6 +97,7 @@ class ApiController(JSONRPCController):
 
            firstname=user.name,
 
            lastname=user.lastname,
 
            email=user.email,
 
            emails=user.emails,
 
            active=user.active,
 
            admin=user.admin,
 
            ldap_dn=user.ldap_dn,
rhodecode/model/db.py
Show inline comments
 
@@ -341,6 +341,11 @@ class User(Base, BaseModel):
 
        self._email = val.lower() if val else None
 

	
 
    @property
 
    def emails(self):
 
        other = UserEmailMap.query().filter(UserEmailMap.user==self).all()
 
        return [self.email] + [x.email for x in other]
 

	
 
    @property
 
    def full_name(self):
 
        return '%s %s' % (self.name, self.lastname)
 

	
0 comments (0 inline, 0 general)