Mercurial > kallithea
diff rhodecode/lib/helpers.py @ 2725:3853e37db97c beta
fixes issue #531, when extracting user email, we check it against the database,
and return user default email. Also if no email is present check the username
for matching targets.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 21 Aug 2012 19:36:21 +0200 |
parents | 269c6e0b54cc |
children | aa17c7a1b8a5 |
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py Mon Aug 20 21:40:25 2012 +0200 +++ b/rhodecode/lib/helpers.py Tue Aug 21 19:36:21 2012 +0200 @@ -396,8 +396,14 @@ def email_or_none(author): + # extract email from the commit string _email = email(author) if _email != '': + # check it against RhodeCode database, and use the MAIN email for this + # user + user = User.get_by_email(_email, case_insensitive=True, cache=True) + if user is not None: + return user.email return _email # See if it contains a username we can get an email from