audit-logs: added web strip command to audit logs
This commit is contained in:
parent
5664a5498d
commit
2e6238eb76
2 changed files with 9 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ import logging
|
|||
from pyramid.view import view_config
|
||||
|
||||
from rhodecode.apps._base import RepoAppView
|
||||
from rhodecode.lib import audit_logger
|
||||
from rhodecode.lib.auth import (LoginRequired, HasRepoPermissionAnyDecorator,
|
||||
NotAnonymous)
|
||||
from rhodecode.lib.ext_json import json
|
||||
|
|
@ -102,6 +103,13 @@ class StripView(RepoAppView):
|
|||
log.info('Stripped commit %s from repo `%s` by %s' % (
|
||||
commit['rev'], c.repo_info.repo_name, user))
|
||||
data[commit['rev']] = True
|
||||
|
||||
audit_logger.store(
|
||||
action='repo.commit.strip',
|
||||
action_data={'commit_id': commit['rev']},
|
||||
repo=self.db_repo,
|
||||
user=self._rhodecode_user, commit=True)
|
||||
|
||||
except Exception as e:
|
||||
data[commit['rev']] = False
|
||||
log.debug('Stripped commit %s from repo `%s` failed by %s, exeption %s' % (
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ ACTIONS = {
|
|||
|
||||
'repo.add': {},
|
||||
'repo.edit': {},
|
||||
'repo.commit.strip': {}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue