db/seeds.d/75-job_templates.rb in katello-3.8.0.rc1 vs db/seeds.d/75-job_templates.rb in katello-3.8.0.rc2

- old
+ new

@@ -5,13 +5,16 @@ template_files.reject! { |file| file.end_with?('_ansible_default.erb') } unless Katello.with_ansible? template_files.each do |template| sync = !Rails.env.test? && Setting[:remote_execution_sync_templates] # import! was renamed to import_raw! around 1.3.1 if JobTemplate.respond_to?('import_raw!') - JobTemplate.import_raw!(File.read(template), :default => true, :locked => true, :update => sync) + template = JobTemplate.import_raw!(File.read(template), :default => true, :locked => true, :update => sync) else - JobTemplate.import!(File.read(template), :default => true, :locked => true, :update => sync) + template = JobTemplate.import!(File.read(template), :default => true, :locked => true, :update => sync) end + + template.organizations << Organization.unscoped.all if template && template.organizations.empty? + template.locations << Location.unscoped.all if template && template.locations.empty? end end end end