Changeset - 28b845dca1fd
[Not reviewed]
default
0 1 0
Mads Kiilerich (mads) - 5 years ago 2020-11-02 14:30:22
mads@kiilerich.com
Grafted from: cdc0eee2565f
lib: drop unnecessary user db lookup in log_pull_action
1 file changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/hooks.py
Show inline comments
 
@@ -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):
0 comments (0 inline, 0 general)