Changeset - 3853e37db97c
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2012-08-21 19:36:21
marcin@python-works.com
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.
2 files changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/helpers.py
Show inline comments
 
@@ -396,8 +396,14 @@ def is_hg(repository):
 

	
 

	
 
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
rhodecode/templates/changeset/changeset.html
Show inline comments
 
@@ -53,7 +53,7 @@
 
	             <div class="left">
 
	                 <div class="author">
 
	                     <div class="gravatar">
 
	                         <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),20)}"/>
 
	                         <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(c.changeset.author),20)}"/>
 
	                     </div>
 
	                     <span>${h.person(c.changeset.author)}</span><br/>
 
	                     <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/>
0 comments (0 inline, 0 general)