dont insert "-1" in any case to issue.poster_id

This commit is contained in:
6543 2019-12-29 03:49:26 +01:00
parent 408b522634
commit 05469ab6d8
No known key found for this signature in database
GPG key ID: A1CA74D27FD13271

View file

@ -1569,6 +1569,12 @@ func SearchIssueIDsByKeyword(kw string, repoIDs []int64, limit, start int) (int6
} }
func updateIssue(e Engine, issue *Issue) error { 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) _, err := e.ID(issue.ID).AllCols().Update(issue)
if err != nil { if err != nil {
return err return err