Don't use repository object anywhere in endpoints/api/repositorynotification
Also adds support for audit logging with repo name only
This commit is contained in:
parent
047722b295
commit
9dad44e93d
5 changed files with 36 additions and 41 deletions
|
@ -349,7 +349,12 @@ def request_error(exception=None, **kwargs):
|
|||
def log_action(kind, user_or_orgname, metadata=None, repo=None, repo_name=None):
|
||||
if not metadata:
|
||||
metadata = {}
|
||||
|
||||
|
||||
if repo_name:
|
||||
repository = model.repository.get_repository(user_or_orgname, repo_name)
|
||||
else:
|
||||
repository = repo
|
||||
|
||||
oauth_token = get_validated_oauth_token()
|
||||
if oauth_token:
|
||||
metadata['oauth_token_id'] = oauth_token.id
|
||||
|
|
Reference in a new issue