From d52ba1a803420be69c9794108bfa8bedccfb9426 Mon Sep 17 00:00:00 2001 From: Sam Lucidi Date: Wed, 29 Nov 2023 21:47:20 -0500 Subject: [PATCH] Omit thresholds from assessment update Fixes https://issues.redhat.com/browse/MTA-1746 Signed-off-by: Sam Lucidi --- api/assessment.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/assessment.go b/api/assessment.go index 72e1af2b9..e9af7f141 100644 --- a/api/assessment.go +++ b/api/assessment.go @@ -2,11 +2,12 @@ package api import ( "encoding/json" + "net/http" + "github.com/gin-gonic/gin" "github.com/konveyor/tackle2-hub/assessment" "github.com/konveyor/tackle2-hub/model" "gorm.io/gorm/clause" - "net/http" ) // @@ -127,7 +128,7 @@ func (h AssessmentHandler) Update(ctx *gin.Context) { m.ID = id m.UpdateUser = h.CurrentUser(ctx) db := h.DB(ctx).Model(m) - db = db.Omit(clause.Associations) + db = db.Omit(clause.Associations, "Thresholds", "RiskMessages") result := db.Updates(h.fields(m)) if result.Error != nil { _ = ctx.Error(result.Error)