@@ -475,48 +475,50 @@ def fmt_date(date):
return ""
def is_git(repository):
if hasattr(repository, 'alias'):
_type = repository.alias
elif hasattr(repository, 'repo_type'):
_type = repository.repo_type
else:
_type = repository
return _type == 'git'
def is_hg(repository):
return _type == 'hg'
def email_or_none(author):
if not author:
return None
# extract email from the commit string
_email = email(author)
if _email:
# check it against Kallithea 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
user = User.get_by_username(author_name(author), case_insensitive=True,
cache=True)
# No valid email, not a valid user in the system, none!
def person(author, show_attr="username"):
# attr to return from fetched user
person_getter = lambda usr: getattr(usr, show_attr)
Status change: