move CreateReview to moduels/pull (#7841)

This commit is contained in:
Lunny Xiao 2019-08-14 23:32:19 +08:00 committed by GitHub
parent eaa4d4ea98
commit c021890930
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 38 deletions

View file

@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
pull_service "code.gitea.io/gitea/modules/pull"
)
// CreateCodeComment will create a code comment including an pending review if required
@ -53,7 +54,7 @@ func CreateCodeComment(ctx *context.Context, form auth.CodeCommentForm) {
}
// No pending review exists
// Create a new pending review for this issue & user
if review, err = models.CreateReview(models.CreateReviewOptions{
if review, err = pull_service.CreateReview(models.CreateReviewOptions{
Type: models.ReviewTypePending,
Reviewer: ctx.User,
Issue: issue,
@ -61,6 +62,7 @@ func CreateCodeComment(ctx *context.Context, form auth.CodeCommentForm) {
ctx.ServerError("CreateCodeComment", err)
return
}
}
}
if review.ID == 0 {