Skip to content

Commit

Permalink
Fixes #37782 - Deleting published repos from product page doesn't wor…
Browse files Browse the repository at this point in the history
…k right
  • Loading branch information
sjha4 committed Sep 5, 2024
1 parent baa0512 commit d6042ce
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Api::V2::RepositoriesBulkActionsController < Api::V2::ApiController
param :ids, Array, :desc => N_("List of repository ids"), :required => true
def destroy_repositories
deletion_authorized_repositories = @repositories.deletable
unpromoted_repos = Setting.find_by(name: 'delete_repo_across_cv')&.value ? deletion_authorized_repositories : deletion_authorized_repositories.reject { |repo| repo.promoted? && repo.content_views.generated_for_none.exists? }
unpromoted_repos = Setting[:delete_repo_across_cv] ? deletion_authorized_repositories : deletion_authorized_repositories.reject { |repo| repo.promoted? && repo.content_views.generated_for_none.exists? }
unpromoted_repos_non_last_affected_repo = unpromoted_repos.reject { |repo| repo.filters.any? { |filter| filter.repositories.size == 1 } }
messages1 = format_bulk_action_messages(
:success => "",
Expand Down Expand Up @@ -36,7 +36,7 @@ def destroy_repositories
task = async_task(::Actions::BulkAction,
::Actions::Katello::Repository::Destroy,
unpromoted_repos_non_last_affected_repo,
remove_from_content_view_versions: Setting.find_by(name: 'delete_repo_across_cv')&.value
remove_from_content_view_versions: Setting[:delete_repo_across_cv]
)
else
status = 400
Expand Down

0 comments on commit d6042ce

Please sign in to comment.