diff --git a/app/models/katello/content_view.rb b/app/models/katello/content_view.rb index f434fddca33..7f0a8c7f1eb 100644 --- a/app/models/katello/content_view.rb +++ b/app/models/katello/content_view.rb @@ -712,6 +712,7 @@ def check_orphaned_content_facets!(environments: []) end def check_remove_from_environment!(env) + check_orphaned_content_facets!(environments: [env]) errors = [] dependencies = { hosts: _("hosts"), @@ -730,6 +731,7 @@ def check_remove_from_environment!(env) end def check_ready_to_destroy! + check_orphaned_content_facets!(environments: self.environments) errors = [] dependencies = { environments: _("environments"),