Re-add the removed pull_username code.
This commit is contained in:
parent
64c9081587
commit
03198210c3
1 changed files with 11 additions and 8 deletions
|
@ -173,8 +173,6 @@ def create_repository(namespace, repository):
|
|||
'namespace': namespace
|
||||
}
|
||||
|
||||
description = ''
|
||||
|
||||
if get_authenticated_user():
|
||||
mixpanel.track(get_authenticated_user().username, 'push_repo',
|
||||
extra_params)
|
||||
|
@ -184,9 +182,8 @@ def create_repository(namespace, repository):
|
|||
metadata['token'] = get_validated_token().friendly_name
|
||||
metadata['token_code'] = get_validated_token().code
|
||||
|
||||
model.log_action('push_repo', namespace, performer = get_authenticated_user(), ip = request.remote_addr,
|
||||
metadata = metadata,
|
||||
repository = repo)
|
||||
model.log_action('push_repo', namespace, performer=get_authenticated_user(),
|
||||
ip=request.remote_addr, metadata=metadata, repository=repo)
|
||||
|
||||
return response
|
||||
|
||||
|
@ -268,20 +265,26 @@ def get_repository_images(namespace, repository):
|
|||
'namespace': namespace,
|
||||
}
|
||||
if get_authenticated_user():
|
||||
metadata['username']= get_authenticated_user().username
|
||||
metadata['username'] = get_authenticated_user().username
|
||||
elif get_validated_token():
|
||||
metadata['token'] = get_validated_token().friendly_name
|
||||
metadata['token_code'] = get_validated_token().code
|
||||
else:
|
||||
metadata['public'] = True
|
||||
|
||||
pull_username = 'anonymous'
|
||||
if get_authenticated_user():
|
||||
pull_username = get_authenticated_user().username
|
||||
|
||||
extra_params = {
|
||||
'repository': '%s/%s' % (namespace, repository),
|
||||
}
|
||||
|
||||
mixpanel.track(pull_username, 'pull_repo', extra_params)
|
||||
model.log_action('pull_repo', namespace, performer = get_authenticated_user(), ip = request.remote_addr,
|
||||
metadata = metadata, repository = repo)
|
||||
model.log_action('pull_repo', namespace,
|
||||
performer=get_authenticated_user(),
|
||||
ip=request.remote_addr, metadata=metadata,
|
||||
repository=repo)
|
||||
return resp
|
||||
|
||||
abort(403)
|
||||
|
|
Reference in a new issue