Skip to content

Commit 088759f

Browse files
lunnysapk
authored andcommitted
Fix wrong identify poster on a migrated pull request when submi… (#9827)
1 parent 3c07d03 commit 088759f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

models/issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ func (issue *Issue) HashTag() string {
440440

441441
// IsPoster returns true if given user by ID is the poster.
442442
func (issue *Issue) IsPoster(uid int64) bool {
443-
return issue.PosterID == uid
443+
return issue.OriginalAuthorID == 0 && issue.PosterID == uid
444444
}
445445

446446
func (issue *Issue) hasLabel(e Engine, labelID int64) bool {

routers/repo/pull_review.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {
8383

8484
// can not approve/reject your own PR
8585
case models.ReviewTypeApprove, models.ReviewTypeReject:
86-
if issue.Poster.ID == ctx.User.ID {
86+
if issue.IsPoster(ctx.User.ID) {
8787
var translated string
8888
if reviewType == models.ReviewTypeApprove {
8989
translated = ctx.Tr("repo.issues.review.self.approval")

0 commit comments

Comments
 (0)