##// END OF EJS Templates
audit-logs: implement enum sources that should be re-used.
marcink -
r1798:bf108a7c default
parent child Browse files
Show More
@@ -1181,7 +1181,8 b' def delete_repo(request, apiuser, repoid'
1181 1181
1182 1182 audit_logger.store(
1183 1183 action='repo.delete',
1184 action_data={'repo_data': repo_data, 'source': 'api_call'},
1184 action_data={'repo_data': repo_data,
1185 'source': audit_logger.SOURCE_API},
1185 1186 user=apiuser, repo=repo, commit=False)
1186 1187
1187 1188 ScmModel().mark_for_invalidation(repo_name, delete=True)
@@ -101,7 +101,8 b' class RepoSettingsView(RepoAppView):'
101 101 repo_name=self.db_repo.repo_name)
102 102 audit_logger.store(
103 103 action='repo.delete',
104 action_data={'repo_data': repo_data, 'source': 'web_action'},
104 action_data={'repo_data': repo_data,
105 'source': audit_logger.SOURCE_WEB},
105 106 user=self._rhodecode_user, repo=repo, commit=False)
106 107
107 108 ScmModel().mark_for_invalidation(self.db_repo_name, delete=True)
@@ -44,6 +44,9 b' ACTIONS = {'
44 44 'repo.archive.download': {},
45 45 }
46 46
47 SOURCE_WEB = 'source_web'
48 SOURCE_API = 'source_api'
49
47 50
48 51 class UserWrap(object):
49 52 """
@@ -114,7 +117,8 b' def store('
114 117 # repo action, when we know and have the repository object already
115 118 audit_logger.store(
116 119 action='repo.delete',
117 user=audit_logger.UserWrap(username='itried-login', ip_addr='8.8.8.8'),
120 action_data={'source': audit_logger.SOURCE_WEB, },
121 user=self._rhodecode_user,
118 122 repo=repo_object)
119 123
120 124 # without an user ?
General Comments 0
You need to be logged in to leave comments. Login now