##// END OF EJS Templates
audit-logs: use auth_user in few places to track action IP.
marcink -
r2788:e5ba79e3 default
parent child Browse files
Show More
@@ -677,7 +677,8 b' def create_pull_request('
677 [commit.raw_id for commit in reversed(commit_ranges)]),
677 [commit.raw_id for commit in reversed(commit_ranges)]),
678 reviewers=reviewers,
678 reviewers=reviewers,
679 title=title,
679 title=title,
680 description=Optional.extract(description)
680 description=Optional.extract(description),
681 auth_user=apiuser
681 )
682 )
682
683
683 Session().commit()
684 Session().commit()
@@ -894,7 +894,8 b' class RepoPullRequestsView(RepoAppView, '
894 pull_request = PullRequestModel().create(
894 pull_request = PullRequestModel().create(
895 self._rhodecode_user.user_id, source_repo, source_ref,
895 self._rhodecode_user.user_id, source_repo, source_ref,
896 target_repo, target_ref, commit_ids, reviewers,
896 target_repo, target_ref, commit_ids, reviewers,
897 pullrequest_title, description, reviewer_rules
897 pullrequest_title, description, reviewer_rules,
898 auth_user=self._rhodecode_user
898 )
899 )
899 Session().commit()
900 Session().commit()
900
901
@@ -1203,7 +1204,8 b' class RepoPullRequestsView(RepoAppView, '
1203 status_change_type=(status
1204 status_change_type=(status
1204 if status and allowed_to_change_status else None),
1205 if status and allowed_to_change_status else None),
1205 comment_type=comment_type,
1206 comment_type=comment_type,
1206 resolves_comment_id=resolves_comment_id
1207 resolves_comment_id=resolves_comment_id,
1208 auth_user=self._rhodecode_user
1207 )
1209 )
1208
1210
1209 if allowed_to_change_status:
1211 if allowed_to_change_status:
@@ -444,10 +444,11 b' class PullRequestModel(BaseModel):'
444
444
445 def create(self, created_by, source_repo, source_ref, target_repo,
445 def create(self, created_by, source_repo, source_ref, target_repo,
446 target_ref, revisions, reviewers, title, description=None,
446 target_ref, revisions, reviewers, title, description=None,
447 reviewer_data=None, translator=None):
447 reviewer_data=None, translator=None, auth_user=None):
448 translator = translator or get_current_request().translate
448 translator = translator or get_current_request().translate
449
449
450 created_by_user = self._get_user(created_by)
450 created_by_user = self._get_user(created_by)
451 auth_user = auth_user or created_by_user
451 source_repo = self._get_repo(source_repo)
452 source_repo = self._get_repo(source_repo)
452 target_repo = self._get_repo(target_repo)
453 target_repo = self._get_repo(target_repo)
453
454
@@ -537,7 +538,7 b' class PullRequestModel(BaseModel):'
537 creation_data = pull_request.get_api_data(with_merge_state=False)
538 creation_data = pull_request.get_api_data(with_merge_state=False)
538 self._log_audit_action(
539 self._log_audit_action(
539 'repo.pull_request.create', {'data': creation_data},
540 'repo.pull_request.create', {'data': creation_data},
540 created_by_user, pull_request)
541 auth_user, pull_request)
541
542
542 return pull_request
543 return pull_request
543
544
General Comments 0
You need to be logged in to leave comments. Login now