From c599c939b807db059d0d08c471ab80d692023aad Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Tue, 12 Dec 2023 12:18:12 +0100 Subject: [PATCH] Fix project assignment activity & notification recipients [SCI-9863] --- app/controllers/access_permissions/projects_controller.rb | 6 ++---- app/notifications/recipients/assigned_recipients.rb | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/access_permissions/projects_controller.rb b/app/controllers/access_permissions/projects_controller.rb index ba9c31435..50a4ce2e3 100644 --- a/app/controllers/access_permissions/projects_controller.rb +++ b/app/controllers/access_permissions/projects_controller.rb @@ -35,10 +35,8 @@ module AccessPermissions @user_assignment.update!(permitted_update_params) - unless current_user.id == @user_assignment.user.id - log_activity(:change_user_role_on_project, { user_target: @user_assignment.user.id, - role: @user_assignment.user_role.name }) - end + log_activity(:change_user_role_on_project, { user_target: @user_assignment.user.id, + role: @user_assignment.user_role.name }) propagate_job(@user_assignment) render :project_member diff --git a/app/notifications/recipients/assigned_recipients.rb b/app/notifications/recipients/assigned_recipients.rb index 54686cf1b..2a2f9ce2a 100644 --- a/app/notifications/recipients/assigned_recipients.rb +++ b/app/notifications/recipients/assigned_recipients.rb @@ -8,5 +8,6 @@ class Recipients::AssignedRecipients def recipients activity = Activity.find(@params[:activity_id]) User.where(id: activity.values.dig('message_items', 'user_target', 'id')) + .where.not(id: activity.owner_id) end end