Changeset - 30cafecb2630
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-08-28 09:04:02
marcin@python-works.com
Fixed issue with mixed locking notification and bad username
1 file changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/hooks.py
Show inline comments
 
@@ -107,15 +107,15 @@ def pre_push(ui, repo, **kwargs):
 
        scm = rc_extras['scm']
 
        locked_by = rc_extras['locked_by']
 
    else:
 
        raise Exception('Missing data in repo.ui and os.environ')
 

	
 
    usr = User.get_by_username(username)
 

	
 
    if locked_by[0] and usr.user_id != int(locked_by[0]):
 
        raise HTTPLockedRC(username, repository)
 
        locked_by = User.get(locked_by[0]).username
 
        raise HTTPLockedRC(repository, locked_by)
 

	
 

	
 
def pre_pull(ui, repo, **kwargs):
 
    # pre push function, currently used to ban pushing when
 
    # repository is locked
 
    try:
 
@@ -134,13 +134,14 @@ def pre_pull(ui, repo, **kwargs):
 
        scm = rc_extras['scm']
 
        locked_by = rc_extras['locked_by']
 
    else:
 
        raise Exception('Missing data in repo.ui and os.environ')
 

	
 
    if locked_by[0]:
 
        raise HTTPLockedRC(username, repository)
 
        locked_by = User.get(locked_by[0]).username
 
        raise HTTPLockedRC(repository, locked_by)
 

	
 

	
 
def log_pull_action(ui, repo, **kwargs):
 
    """
 
    Logs user last pull action
 

	
0 comments (0 inline, 0 general)