1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-09 02:58:20 +00:00

Hotfix for review actions and notifications (#8965)

This commit is contained in:
guillep2k
2019-11-13 21:38:12 -03:00
committed by zeripath
parent 3227a11f71
commit 023ae3c48c
3 changed files with 23 additions and 9 deletions

View File

@@ -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 {