diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index cada797d693..80ae8bbaa99 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -363,7 +363,7 @@ type CodeCommentForm struct { Line int64 TreePath string `form:"path" binding:"Required"` CommitSHA string `form:"commit_id" binding:"Required"` - IsReview bool `form:"is_review" binding:"Required"` + IsReview bool `form:"is_review"` } // Validate validates the fields diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 3768b3f3856..a300d78366a 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -477,7 +477,11 @@ func ViewPullFiles(ctx *context.Context) { return } ctx.Data["CodeComments"] = pathToLineToComment - + ctx.Data["CurrentReview"], err = models.GetCurrentReview(ctx.User, issue) + if err != nil && !models.IsErrReviewNotExist(err) { + ctx.ServerError("GetCurrentReview", err) + return + } ctx.HTML(200, tplPullFiles) } diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl index ea604bcc451..a27494ab425 100644 --- a/templates/repo/diff/comment_form.tmpl +++ b/templates/repo/diff/comment_form.tmpl @@ -4,7 +4,6 @@ - @@ -23,10 +22,16 @@