Print pull dont crash if it has TeamReviewRequests (#517)
partial backport of #515 Reviewed-on: https://gitea.com/gitea/tea/pulls/517 Reviewed-by: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
parent
6c9b2f8745
commit
c00418e74c
|
@ -99,11 +99,14 @@ func formatReviews(reviews []*gitea.PullReview) string {
|
||||||
case gitea.ReviewStateApproved,
|
case gitea.ReviewStateApproved,
|
||||||
gitea.ReviewStateRequestChanges,
|
gitea.ReviewStateRequestChanges,
|
||||||
gitea.ReviewStateRequestReview:
|
gitea.ReviewStateRequestReview:
|
||||||
|
// only user reviews are supported no team review requests
|
||||||
|
if review.Reviewer != nil {
|
||||||
if r, ok := reviewByUser[review.Reviewer.ID]; !ok || review.Submitted.After(r.Submitted) {
|
if r, ok := reviewByUser[review.Reviewer.ID]; !ok || review.Submitted.After(r.Submitted) {
|
||||||
reviewByUser[review.Reviewer.ID] = review
|
reviewByUser[review.Reviewer.ID] = review
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// group reviews by type
|
// group reviews by type
|
||||||
usersByState := make(map[gitea.ReviewStateType][]string)
|
usersByState := make(map[gitea.ReviewStateType][]string)
|
||||||
|
|
Loading…
Reference in New Issue