Skip to content

Commit

Permalink
dont insert "-1" in any case to issue.poster_id
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Dec 29, 2019
1 parent 408b522 commit 05469ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 05469ab

Please sign in to comment.