summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/pull_review.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/routers/repo/pull_review.go b/routers/repo/pull_review.go
index 5eb0dfe9a7..4c17537071 100644
--- a/routers/repo/pull_review.go
+++ b/routers/repo/pull_review.go
@@ -174,6 +174,12 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {
return
}
}
+
+ // Hotfix 1.10.0: make sure the review exists before creating the head comment
+ if err = review.Publish(); err != nil {
+ ctx.ServerError("Publish", err)
+ return
+ }
comm, err := models.CreateComment(&models.CreateCommentOptions{
Type: models.CommentTypeReview,
Doer: ctx.User,
@@ -186,10 +192,6 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {
ctx.ServerError("CreateComment", err)
return
}
- if err = review.Publish(); err != nil {
- ctx.ServerError("Publish", err)
- return
- }
pr, err := issue.GetPullRequest()
if err != nil {