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 authored and GitHub committed 2021-04-15 11:03:11 +01:00
1 parent 61bae620c1
commit 9d07facdeb
2 files changed
+58 -8

No files matched your search

+5 -1
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
}