Преглед на файлове

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

tags/v1.10.3
Lunny Xiao преди 4 години
родител
ревизия
918e640590
променени са 2 файла, в които са добавени 2 реда и са изтрити 4 реда
  1. 1
    1
      models/issue.go
  2. 1
    3
      routers/repo/pull_review.go

+ 1
- 1
models/issue.go Целия файл

@@ -429,7 +429,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
- 3
routers/repo/pull_review.go Целия файл

@@ -117,9 +117,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 {

Loading…
Отказ
Запис