From b59456279edcd76857775a971a7147a40ba742a4 Mon Sep 17 00:00:00 2001 From: Jeremy Lenz Date: Fri, 24 Jan 2025 10:16:45 -0500 Subject: [PATCH] Fixes #38147 - correctly find org on FakeActivationKey (#11280) --- app/lib/katello/util/cveak_migrator.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/lib/katello/util/cveak_migrator.rb b/app/lib/katello/util/cveak_migrator.rb index 697079d4282..81b70c61368 100644 --- a/app/lib/katello/util/cveak_migrator.rb +++ b/app/lib/katello/util/cveak_migrator.rb @@ -27,8 +27,9 @@ def execute! Rails.logger.info "You may want to change the content view / lifecycle environment for these activation keys manually." end (aks_with_no_cve + aks_with_missing_cve).each do |ak| - default_content_view = ak.organization.default_content_view - library = ak.organization.library + ak_organization = ::Organization.find_by(id: ak.organization_id) + default_content_view = ak_organization.default_content_view + library = ak_organization.library Rails.logger.info "Updating activation key #{ak.name} with default content_view_id and lifecycle_environment_id" ak&.update_columns(content_view_id: default_content_view&.id, environment_id: library&.id) end