diff --git a/kallithea/controllers/files.py b/kallithea/controllers/files.py --- a/kallithea/controllers/files.py +++ b/kallithea/controllers/files.py @@ -51,6 +51,7 @@ from kallithea.lib.vcs.conf import setti from kallithea.lib.vcs.exceptions import (ChangesetDoesNotExistError, ChangesetError, EmptyRepositoryError, ImproperArchiveTypeError, NodeAlreadyExistsError, NodeDoesNotExistError, NodeError, RepositoryError, VCSError) from kallithea.lib.vcs.nodes import FileNode +from kallithea.lib.vcs.utils import author_email from kallithea.lib.webutils import url from kallithea.model.repo import RepoModel from kallithea.model.scm import ScmModel @@ -170,7 +171,7 @@ class FilesController(BaseRepoController c.authors = [] for a in set([x.author for x in _hist]): - c.authors.append((h.email(a), h.person(a))) + c.authors.append((author_email(a), h.person(a))) else: c.authors = c.file_history = [] except RepositoryError as e: @@ -222,7 +223,7 @@ class FilesController(BaseRepoController file_history, _hist = self._get_node_history(changeset, f_path) c.authors = [] for a in set([x.author for x in _hist]): - c.authors.append((h.email(a), h.person(a))) + c.authors.append((author_email(a), h.person(a))) return render('files/files_history_box.html') @LoginRequired(allow_default_user=True) diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -542,8 +542,6 @@ def pop_flash_messages(): def capitalize(x): return x.capitalize() -email = author_email - def short_id(x): return x[:12] @@ -636,7 +634,7 @@ def person(author, show_attr="username") return value # Still nothing? Just pass back the author name if any, else the email - return author_name(author) or email(author) + return author_name(author) or author_email(author) def person_by_id(id_, show_attr="username"): diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -49,6 +49,7 @@ from kallithea.lib.exceptions import Def from kallithea.lib.utils2 import asbool, ascii_bytes, aslist, get_changeset_safe, get_clone_url, remove_prefix, safe_bytes, safe_int, safe_str, urlreadable from kallithea.lib.vcs import get_backend from kallithea.lib.vcs.backends.base import EmptyChangeset +from kallithea.lib.vcs.utils import author_email, author_name from kallithea.lib.vcs.utils.helpers import get_scm from kallithea.model import meta @@ -591,13 +592,9 @@ class User(meta.Base, BaseDbModel): def get_from_cs_author(cls, author): """ Tries to get User objects out of commit author string - - :param author: """ - from kallithea.lib.helpers import author_name, email - # Valid email in the attribute passed, see if they're in the system - _email = email(author) + _email = author_email(author) if _email: user = cls.get_by_email(_email) if user is not None: