Mercurial > public > src > rhodecode
changeset 2608:7e3e9d0c5575 beta
Add list of all emails that user may have into get_user call
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 25 Jun 2012 23:16:14 +0200 |
parents | 02fc6ce0cd44 |
children | 374693af2849 |
files | docs/api/api.rst rhodecode/controllers/api/api.py rhodecode/model/db.py |
diffstat | 3 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/api/api.rst Mon Jun 25 23:08:06 2012 +0200 +++ b/docs/api/api.rst Mon Jun 25 23:16:14 2012 +0200 @@ -152,6 +152,7 @@ "firstname": "<firstname>", "lastname" : "<lastname>", "email" : "<email>", + "emails": "<list_of_all_additional_emails>", "active" : "<bool>", "admin" : "<bool>", "ldap_dn" : "<ldap_dn>",
--- a/rhodecode/controllers/api/api.py Mon Jun 25 23:08:06 2012 +0200 +++ b/rhodecode/controllers/api/api.py Mon Jun 25 23:16:14 2012 +0200 @@ -97,6 +97,7 @@ firstname=user.name, lastname=user.lastname, email=user.email, + emails=user.emails, active=user.active, admin=user.admin, ldap_dn=user.ldap_dn,
--- a/rhodecode/model/db.py Mon Jun 25 23:08:06 2012 +0200 +++ b/rhodecode/model/db.py Mon Jun 25 23:16:14 2012 +0200 @@ -341,6 +341,11 @@ 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)