forked from Katello/katello
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #37772 - Add controller guardrails for multi-CV params (Katello…
…#11139) also some light refactoring around candlepin names and content view environments Refs #37772 - allow for clearing of CVEs on AK Refs #37772 - don't clear CVEs on AngularJS update
- Loading branch information
1 parent
c2cabf9
commit 31b5c98
Showing
9 changed files
with
296 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module Katello | ||
module Concerns | ||
module Api::V2::MultiCVParamsHandling | ||
extend ActiveSupport::Concern | ||
include ::Katello::Api::V2::ErrorHandling | ||
|
||
def handle_errors(candlepin_names: [], ids: []) | ||
if candlepin_names.present? | ||
fail HttpErrors::UnprocessableEntity, "No content view environments found with names: #{candlepin_names.join(',')}" | ||
elsif ids.present? | ||
fail HttpErrors::UnprocessableEntity, "No content view environments found with ids: #{ids}" | ||
end | ||
rescue HttpErrors::UnprocessableEntity => error | ||
respond_for_exception( | ||
error, | ||
:status => :unprocessable_entity, | ||
:text => error.message, | ||
:errors => [error.message], | ||
:with_logging => true | ||
) | ||
end | ||
end | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
app/lib/actions/pulp3/repository/update_cv_repository_cert_guard.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.