Commit 80daf9a7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Use current_user for Notification#merge_mr

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 8bbac457
...@@ -12,7 +12,7 @@ module MergeRequests ...@@ -12,7 +12,7 @@ module MergeRequests
merge_request.author_id_of_changes = current_user.id merge_request.author_id_of_changes = current_user.id
merge_request.merge merge_request.merge
notification.merge_mr(merge_request) notification.merge_mr(merge_request, current_user)
create_merge_event(merge_request) create_merge_event(merge_request)
execute_project_hooks(merge_request) execute_project_hooks(merge_request)
......
...@@ -10,7 +10,7 @@ module MergeRequests ...@@ -10,7 +10,7 @@ module MergeRequests
merge_request.author_id_of_changes = current_user.id merge_request.author_id_of_changes = current_user.id
merge_request.merge merge_request.merge
notification.merge_mr(merge_request) notification.merge_mr(merge_request, current_user)
create_merge_event(merge_request) create_merge_event(merge_request)
execute_project_hooks(merge_request) execute_project_hooks(merge_request)
......
...@@ -86,12 +86,12 @@ class NotificationService ...@@ -86,12 +86,12 @@ class NotificationService
# * merge_request assignee if their notification level is not Disabled # * merge_request assignee if their notification level is not Disabled
# * project team members with notification level higher then Participating # * project team members with notification level higher then Participating
# #
def merge_mr(merge_request) def merge_mr(merge_request, current_user)
recipients = reject_muted_users([merge_request.author, merge_request.assignee], merge_request.target_project) recipients = reject_muted_users([merge_request.author, merge_request.assignee], merge_request.target_project)
recipients = recipients.concat(project_watchers(merge_request.target_project)).uniq recipients = recipients.concat(project_watchers(merge_request.target_project)).uniq
recipients.each do |recipient| recipients.each do |recipient|
mailer.merged_merge_request_email(recipient.id, merge_request.id, merge_request.author_id_of_changes) mailer.merged_merge_request_email(recipient.id, merge_request.id, current_user.id)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment