diff options
Diffstat (limited to 'routers/web/repo/pull_review.go')
-rw-r--r-- | routers/web/repo/pull_review.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/routers/web/repo/pull_review.go b/routers/web/repo/pull_review.go index 1645155bf8..f7c962d1ae 100644 --- a/routers/web/repo/pull_review.go +++ b/routers/web/repo/pull_review.go @@ -28,6 +28,9 @@ const ( // RenderNewCodeCommentForm will render the form for creating a new review comment func RenderNewCodeCommentForm(ctx *context.Context) { issue := GetActionIssue(ctx) + if ctx.Written() { + return + } if !issue.IsPull { return } @@ -52,10 +55,10 @@ func RenderNewCodeCommentForm(ctx *context.Context) { func CreateCodeComment(ctx *context.Context) { form := web.GetForm(ctx).(*forms.CodeCommentForm) issue := GetActionIssue(ctx) - if !issue.IsPull { + if ctx.Written() { return } - if ctx.Written() { + if !issue.IsPull { return } @@ -185,10 +188,10 @@ func renderConversation(ctx *context.Context, comment *issues_model.Comment) { func SubmitReview(ctx *context.Context) { form := web.GetForm(ctx).(*forms.SubmitReviewForm) issue := GetActionIssue(ctx) - if !issue.IsPull { + if ctx.Written() { return } - if ctx.Written() { + if !issue.IsPull { return } if ctx.HasError() { |