Skip to content

Commit

Permalink
RHINENG-10521: get list of systems _before_ we remove them
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMraka authored and psegedy committed Jun 7, 2024
1 parent d88b116 commit 5e7dd3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manager/controllers/baseline_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func BaselineDeleteHandler(c *gin.Context) {
tx := middlewares.DBFromContext(c).Begin()
defer tx.Rollback()

inventoryAIDs := kafka.GetInventoryIDsToEvaluate(tx, &baselineID, account, true, nil)
err = tx.Model(models.SystemPlatform{}).
Where("rh_account_id = ? AND baseline_id = ?", account, baselineID).
Select("baseline_id").
Expand All @@ -53,7 +54,6 @@ func BaselineDeleteHandler(c *gin.Context) {
return
}

inventoryAIDs := kafka.GetInventoryIDsToEvaluate(tx, &baselineID, account, true, nil)
deleteQuery := tx.Where("rh_account_id = ? AND id = ?", account, baselineID).
Delete(&models.Baseline{})
err = deleteQuery.Error
Expand Down

0 comments on commit 5e7dd3f

Please sign in to comment.