Changeset - ea2c948a49b8
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-04-11 16:55:39
marcin@python-works.com
fixed issue with h.person() function returned prematurly giving only email info from changeset metadata. Thanks to Stevan Radaković
1 file changed with 0 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/helpers.py
Show inline comments
 
@@ -439,25 +439,24 @@ def email_or_none(author):
 

	
 

	
 
def person(author, show_attr="username_and_name"):
 
    # attr to return from fetched user
 
    person_getter = lambda usr: getattr(usr, show_attr)
 

	
 
    # Valid email in the attribute passed, see if they're in the system
 
    _email = email(author)
 
    if _email != '':
 
        user = User.get_by_email(_email, case_insensitive=True, cache=True)
 
        if user is not None:
 
            return person_getter(user)
 
        return _email
 

	
 
    # Maybe it's a username?
 
    _author = author_name(author)
 
    user = User.get_by_username(_author, case_insensitive=True,
 
                                cache=True)
 
    if user is not None:
 
        return person_getter(user)
 

	
 
    # Still nothing?  Just pass back the author name then
 
    return _author
 

	
 

	
0 comments (0 inline, 0 general)