]> source.dussan.org Git - gitea.git/commitdiff
Fix SetExpr failed (#9506)
authorLunny Xiao <xiaolunwen@gmail.com>
Fri, 27 Dec 2019 14:18:07 +0000 (22:18 +0800)
committerzeripath <art27@cantab.net>
Fri, 27 Dec 2019 14:18:07 +0000 (14:18 +0000)
models/update.go

index 1105c9a82895b11870c351af1a6b615bc2b14d83..b6c04bd515ceee1a3febc1e9a803239e3ecb868a 100644 (file)
@@ -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)
        }