mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 03:59:51 +08:00
Remove invalid designated users when moving experiment [SCI-6335] (#3722)
This commit is contained in:
parent
561746158e
commit
c80cbe34f4
1 changed files with 5 additions and 0 deletions
|
@ -31,6 +31,7 @@ module Experiments
|
|||
raise
|
||||
end
|
||||
sync_user_assignments(my_module)
|
||||
clean_up_user_my_modules(my_module)
|
||||
move_tags!(my_module)
|
||||
end
|
||||
|
||||
|
@ -119,6 +120,10 @@ module Experiments
|
|||
UserAssignments::GenerateUserAssignmentsJob.perform_later(object, @user)
|
||||
end
|
||||
|
||||
def clean_up_user_my_modules(my_module)
|
||||
my_module.user_my_modules.where.not(user_id: @project.users.select(:id)).destroy_all
|
||||
end
|
||||
|
||||
def track_activity
|
||||
Activities::CreateActivityService
|
||||
.call(activity_type: :move_experiment,
|
||||
|
|
Loading…
Reference in a new issue