Fix bulk risk acceptance for active findings #14292
Open
+39
−35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #14281
This PR fixes a bug where active findings could not be risk accepted via the bulk edit menu, even though individual risk acceptance worked fine and simple risk acceptance was enabled on the product. This now matches the Pro UI.
Changes
test_bulk_edit_active_finding_can_accept_riskto verify that active findings can now be risk accepted successfully in bulktest_bulk_edit_shows_multiple_warning_messagesto verify no warning appears when risk accepting active findings_bulk_update_risk_acceptancehelper function to return only the count of skipped findingsRoot Cause
The bulk update function incorrectly checked
if finding.active:and skipped risk acceptance for active findings, showing a warning message. However:simple_risk_acceptview) has NO such restrictionsimple_risk_accepthelper function automatically setsfinding.active = Falsewhen accepting riskThis was an inconsistency between bulk and individual operations that had no technical justification.
Behavior Change
Before: Bulk risk acceptance of active findings failed with error message "Active findings cannot be risk accepted"
After: Bulk risk acceptance of active findings works correctly, matching individual behavior. The finding becomes inactive (risk_accepted=True, active=False) after risk acceptance.