Skip to content

Commit 69a2a29

Browse files
lunnysapk
authored andcommitted
Fix wrong identify poster on a migrated pull request when submi… (#9827) (#9830)
1 parent f766719 commit 69a2a29

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
@@ -438,7 +438,7 @@ func (issue *Issue) HashTag() string {
438438

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

444444
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
@@ -81,7 +81,7 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {
8181

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

0 commit comments

Comments
 (0)