diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/issue.go | 4 | ||||
-rw-r--r-- | models/issue_test.go | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/models/issue.go b/models/issue.go index 823d82a765..a27bb1cc7d 100644 --- a/models/issue.go +++ b/models/issue.go @@ -804,7 +804,7 @@ func (issue *Issue) ChangeContent(doer *User, content string) (err error) { return fmt.Errorf("UpdateIssueCols: %v", err) } - if err = issues.SaveIssueContentHistory(db.GetEngine(ctx), issue.PosterID, issue.ID, 0, + if err = issues.SaveIssueContentHistory(db.GetEngine(ctx), doer.ID, issue.ID, 0, timeutil.TimeStampNow(), issue.Content, false); err != nil { return fmt.Errorf("SaveIssueContentHistory: %v", err) } @@ -979,7 +979,7 @@ func newIssue(e db.Engine, doer *User, opts NewIssueOptions) (err error) { return err } - if err = issues.SaveIssueContentHistory(e, opts.Issue.PosterID, opts.Issue.ID, 0, + if err = issues.SaveIssueContentHistory(e, doer.ID, opts.Issue.ID, 0, timeutil.TimeStampNow(), opts.Issue.Content, true); err != nil { return err } diff --git a/models/issue_test.go b/models/issue_test.go index d726a24344..8894d80201 100644 --- a/models/issue_test.go +++ b/models/issue_test.go @@ -357,6 +357,7 @@ func testInsertIssue(t *testing.T, title, content string, expectIndex int64) *Is issue := Issue{ RepoID: repo.ID, PosterID: user.ID, + Poster: user, Title: title, Content: content, } |