From: Lunny Xiao Date: Fri, 27 Dec 2019 14:18:07 +0000 (+0800) Subject: Fix SetExpr failed (#9506) X-Git-Tag: v1.11.0-rc1~73 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3d5f31f77d3f56a954b267fa05f5757c6e538b4e;p=gitea.git Fix SetExpr failed (#9506) --- diff --git a/models/update.go b/models/update.go index 1105c9a828..b6c04bd515 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) }