# HG changeset patch # User Mads Kiilerich # Date 2020-11-02 14:30:22 # Node ID 28b845dca1fd48220e1faab7631afee009a6eac5 # Parent f3e91cd075ebcf49521922861599e04549d00182 lib: drop unnecessary user db lookup in log_pull_action diff --git a/kallithea/lib/hooks.py b/kallithea/lib/hooks.py --- a/kallithea/lib/hooks.py +++ b/kallithea/lib/hooks.py @@ -86,15 +86,14 @@ def repo_size(ui, repo, hooktype=None, * def log_pull_action(ui, repo, **kwargs): """Logs user last pull action - Called as Mercurial hook outgoing.pull_logger or from Kallithea before invoking Git. + Called as Mercurial hook outgoing.kallithea_log_pull_action or from Kallithea before invoking Git. Does *not* use the action from the hook environment but is always 'pull'. """ ex = get_hook_environment() - user = db.User.get_by_username(ex.username) action = 'pull' - action_logger(user, action, ex.repository, ex.ip, commit=True) + action_logger(ex.username, action, ex.repository, ex.ip, commit=True) # extension hook call callback = getattr(kallithea.EXTENSIONS, 'PULL_HOOK', None) if callable(callback):