From 06430c934041d14ab01687c3123fbf71e1f26428 Mon Sep 17 00:00:00 2001 From: artoscinote <85488244+artoscinote@users.noreply.github.com> Date: Wed, 9 Mar 2022 15:30:30 +0100 Subject: [PATCH] Fix moving experiment [SCI-6602] (#3927) --- app/services/experiments/move_to_project_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/experiments/move_to_project_service.rb b/app/services/experiments/move_to_project_service.rb index e6cacd3d9..6252768d4 100644 --- a/app/services/experiments/move_to_project_service.rb +++ b/app/services/experiments/move_to_project_service.rb @@ -25,6 +25,8 @@ module Experiments ActiveRecord::Base.transaction do @exp.project = @project + sync_user_assignments(@exp) + @exp.my_modules.each do |my_module| unless can_move_my_module?(@user, my_module) @errors[:main] = I18n.t('move_to_project_service.my_modules_permission_error') @@ -37,7 +39,6 @@ module Experiments move_activities!(@exp) @exp.save! - sync_user_assignments(@exp) rescue StandardError if @exp.valid? && @errors.none? @errors[:main] = I18n.t('move_to_project_service.general_error')