fix comment content

This commit is contained in:
Lunny Xiao 2019-11-14 09:39:37 +08:00
parent 58bc380724
commit 7a4bb23150
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 2 additions and 3 deletions

View File

@ -124,7 +124,6 @@ func (a *actionNotifier) NotifyPullRequestReview(pr *models.PullRequest, review
log.Error("LoadReviewer '%d/%d': %v", review.ID, review.ReviewerID, err) log.Error("LoadReviewer '%d/%d': %v", review.ID, review.ReviewerID, err)
return return
} }
var content = comment.Content
if err := review.LoadCodeComments(); err != nil { if err := review.LoadCodeComments(); err != nil {
log.Error("LoadCodeComments '%d/%d': %v", review.Reviewer.ID, review.ID, err) log.Error("LoadCodeComments '%d/%d': %v", review.Reviewer.ID, review.ID, err)
return return
@ -137,7 +136,7 @@ func (a *actionNotifier) NotifyPullRequestReview(pr *models.PullRequest, review
actions = append(actions, &models.Action{ actions = append(actions, &models.Action{
ActUserID: review.Reviewer.ID, ActUserID: review.Reviewer.ID,
ActUser: review.Reviewer, ActUser: review.Reviewer,
Content: fmt.Sprintf("%d|%s", review.Issue.Index, strings.Split(content, "\n")[0]), Content: fmt.Sprintf("%d|%s", review.Issue.Index, strings.Split(comm.Content, "\n")[0]),
OpType: models.ActionCommentIssue, OpType: models.ActionCommentIssue,
RepoID: review.Issue.RepoID, RepoID: review.Issue.RepoID,
Repo: review.Issue.Repo, Repo: review.Issue.Repo,
@ -153,7 +152,7 @@ func (a *actionNotifier) NotifyPullRequestReview(pr *models.PullRequest, review
actions = append(actions, &models.Action{ actions = append(actions, &models.Action{
ActUserID: review.Reviewer.ID, ActUserID: review.Reviewer.ID,
ActUser: review.Reviewer, ActUser: review.Reviewer,
Content: fmt.Sprintf("%d|%s", review.Issue.Index, strings.Split(content, "\n")[0]), Content: fmt.Sprintf("%d|%s", review.Issue.Index, strings.Split(comment.Content, "\n")[0]),
OpType: models.ActionCommentIssue, OpType: models.ActionCommentIssue,
RepoID: review.Issue.RepoID, RepoID: review.Issue.RepoID,
Repo: review.Issue.Repo, Repo: review.Issue.Repo,