aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorJimmy Praet <jimmy.praet@telenet.be>2021-10-07 22:39:59 +0200
committerGitHub <noreply@github.com>2021-10-07 22:39:59 +0200
commit25a200078724443afba3eca772d5c7e4db0a83cf (patch)
treecd56356722c4bdfa7270e2c9225351c51b8f2ebc /models
parent46cac263ca9f350fbc414b795e42f79d4d241e28 (diff)
downloadgitea-25a200078724443afba3eca772d5c7e4db0a83cf.tar.gz
gitea-25a200078724443afba3eca772d5c7e4db0a83cf.zip
Fix unwanted team review request deletion (#17257)
Add missing issue_id = ? to where clause Fixes #17251
Diffstat (limited to 'models')
-rw-r--r--models/review.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/review.go b/models/review.go
index 5b12e6ffa2..d456383d9c 100644
--- a/models/review.go
+++ b/models/review.go
@@ -444,7 +444,7 @@ func SubmitReview(doer *User, issue *Issue, reviewType ReviewType, content, comm
// try to remove team review request if need
if issue.Repo.Owner.IsOrganization() && (reviewType == ReviewTypeApprove || reviewType == ReviewTypeReject) {
teamReviewRequests := make([]*Review, 0, 10)
- if err := sess.SQL("SELECT * FROM review WHERE reviewer_team_id > 0 AND type = ?", ReviewTypeRequest).Find(&teamReviewRequests); err != nil {
+ if err := sess.SQL("SELECT * FROM review WHERE issue_id = ? AND reviewer_team_id > 0 AND type = ?", issue.ID, ReviewTypeRequest).Find(&teamReviewRequests); err != nil {
return nil, nil, err
}