소스 검색

Fix wrong identify poster on a migrated pull request when submi… (#9827) (#9830)

tags/v1.11.0-rc2
Lunny Xiao 4 년 전
부모
커밋
69a2a29c33
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1
    1
      models/issue.go
  2. 1
    1
      routers/repo/pull_review.go

+ 1
- 1
models/issue.go 파일 보기

@@ -438,7 +438,7 @@ func (issue *Issue) HashTag() string {

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

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

+ 1
- 1
routers/repo/pull_review.go 파일 보기

@@ -81,7 +81,7 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {

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

Loading…
취소
저장