From 05469ab6d815a6cc6478a256018b9ed1a12749e0 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 29 Dec 2019 03:49:26 +0100 Subject: [PATCH] dont insert "-1" in any case to issue.poster_id --- models/issue.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/models/issue.go b/models/issue.go index 75f7bd818a..b6f542f771 100644 --- a/models/issue.go +++ b/models/issue.go @@ -1569,6 +1569,12 @@ func SearchIssueIDsByKeyword(kw string, repoIDs []int64, limit, start int) (int6 } func updateIssue(e Engine, issue *Issue) error { + if issue.PosterID <= 0 { + _, err := e.Table("`issue`").Where("id = ?", issue.ID).Select("poster_id").Get(&issue.PosterID) + if err != nil { + return err + } + } _, err := e.ID(issue.ID).AllCols().Update(issue) if err != nil { return err -- 2.39.5