summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2019-11-13 21:38:12 -0300
committerzeripath <art27@cantab.net>2019-11-14 00:38:12 +0000
commit023ae3c48cded84dee6bdcbcf7bba8cc92a4a408 (patch)
treeb9cc73815a1657d1a15be1a1358df105a4f90127 /routers
parent3227a11f71200c6018b8af584d34fd85261de264 (diff)
downloadgitea-023ae3c48cded84dee6bdcbcf7bba8cc92a4a408.tar.gz
gitea-023ae3c48cded84dee6bdcbcf7bba8cc92a4a408.zip
Hotfix for review actions and notifications (#8965)
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 {