diff options
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r-- | models/issue_comment.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go index 39c2818eed..ceea878662 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -284,14 +284,15 @@ type PushActionContent struct { // LoadIssue loads issue from database func (c *Comment) LoadIssue() (err error) { - return c.loadIssue(db.GetEngine(db.DefaultContext)) + return c.LoadIssueCtx(db.DefaultContext) } -func (c *Comment) loadIssue(e db.Engine) (err error) { +// LoadIssueCtx loads issue from database +func (c *Comment) LoadIssueCtx(ctx context.Context) (err error) { if c.Issue != nil { return nil } - c.Issue, err = getIssueByID(e, c.IssueID) + c.Issue, err = getIssueByID(db.GetEngine(ctx), c.IssueID) return } @@ -1126,7 +1127,7 @@ func UpdateComment(c *Comment, doer *user_model.User) error { if _, err := sess.ID(c.ID).AllCols().Update(c); err != nil { return err } - if err := c.loadIssue(sess); err != nil { + if err := c.LoadIssueCtx(ctx); err != nil { return err } if err := c.addCrossReferences(ctx, doer, true); err != nil { |