From 3d5f31f77d3f56a954b267fa05f5757c6e538b4e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 27 Dec 2019 22:18:07 +0800 Subject: [PATCH] Fix SetExpr failed (#9506) --- models/update.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/update.go b/models/update.go index 1105c9a8289..b6c04bd515c 100644 --- a/models/update.go +++ b/models/update.go @@ -103,10 +103,10 @@ func pushUpdateDeleteTags(e Engine, repo *Repository, tags []string) error { if _, err := e. Where("repo_id = ? AND is_tag = ?", repo.ID, false). In("lower_tag_name", lowerTags). - SetExpr("is_draft", true). - SetExpr("num_commits", 0). - SetExpr("sha1", ""). - Update(new(Release)); err != nil { + Cols("is_draft", "num_commits", "sha1"). + Update(&Release{ + IsDraft: true, + }); err != nil { return fmt.Errorf("Update: %v", err) }