Block delete for in-progress access review campaigns
Reject deletion while a campaign is fetching sources so workers are not racing a removed record. All other statuses remain deletable. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
@@ -57,6 +57,15 @@ func TestCampaignClientErrors(t *testing.T) {
|
||||
wantText: fmt.Sprintf("access review campaign %q is not in draft", campaignID),
|
||||
sentinel: accessreview.ErrCampaignNotDraft,
|
||||
},
|
||||
{
|
||||
name: "not deletable",
|
||||
err: accessreview.NewCampaignNotDeletableError(campaignID),
|
||||
wantText: fmt.Sprintf(
|
||||
"access review campaign %q cannot be deleted while it is in progress",
|
||||
campaignID,
|
||||
),
|
||||
sentinel: accessreview.ErrCampaignNotDeletable,
|
||||
},
|
||||
{
|
||||
name: "not pending actions",
|
||||
err: accessreview.NewCampaignNotPendingActionsError(campaignID),
|
||||
|
||||
Reference in New Issue
Block a user