Fix moving experiment [SCI-6602] (#3927)

This commit is contained in:
artoscinote 2022-03-09 15:30:30 +01:00 committed by GitHub
parent 7f7bf0533a
commit 06430c9340
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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')