Fix editing of existing reports [SCI-7817] (#4886)

Co-authored-by: Oleksii Kriuchykhin <okriuchykhin@biosistemika.com>
This commit is contained in:
Alex Kriuchykhin 2023-01-25 15:41:59 +01:00 committed by GitHub
parent 59265c096b
commit 7e1d1ffd99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,7 +110,8 @@ class ReportsController < ApplicationController
@project_contents = {
experiments: @report.report_elements.order(:position).experiment.pluck(:experiment_id),
my_modules: @report.report_elements.order(:position).my_module.pluck(:my_module_id),
repositories: @report.settings.dig(:task, :repositories)
repositories: @report.settings.dig(:task, :repositories) ||
@report.report_elements.my_module_repository.distinct(:repository_id).pluck(:repository_id)
}
render :new
end