1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Ensure review dismissal only dismisses the correct review (#15477)

Fix #15472

Signed-off-by: Andrew Thornton art27@cantab.net
This commit is contained in:
zeripath
2021-04-15 11:03:11 +01:00
committed by GitHub
parent 61bae620c1
commit 9d07facdeb
2 changed files with 58 additions and 8 deletions

View File

@@ -566,7 +566,11 @@ func DismissReview(review *Review, isDismiss bool) (err error) {
review.Dismissed = isDismiss
_, err = x.Cols("dismissed").Update(review)
if review.ID == 0 {
return ErrReviewNotExist{}
}
_, err = x.ID(review.ID).Cols("dismissed").Update(review)
return
}