]> source.dussan.org Git - gitea.git/commitdiff
dont insert "-1" in any case to issue.poster_id
author6543 <6543@obermui.de>
Sun, 29 Dec 2019 02:49:26 +0000 (03:49 +0100)
committer6543 <6543@obermui.de>
Sun, 29 Dec 2019 03:08:29 +0000 (04:08 +0100)
models/issue.go

index 75f7bd818aa6eed09ef6b0b42ea06504afddf7ef..b6f542f77117fe1abc45c7eeecb4a13ce4e87227 100644 (file)
@@ -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