From 5e7dd3feed634ffdf3a5d84670a09f22770c29e7 Mon Sep 17 00:00:00 2001 From: Michael Mraka Date: Fri, 7 Jun 2024 14:04:21 +0200 Subject: [PATCH] RHINENG-10521: get list of systems _before_ we remove them --- manager/controllers/baseline_delete.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/controllers/baseline_delete.go b/manager/controllers/baseline_delete.go index 4a398130b..72bef151d 100644 --- a/manager/controllers/baseline_delete.go +++ b/manager/controllers/baseline_delete.go @@ -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"). @@ -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