aboutsummaryrefslogtreecommitdiffstats
path: root/modules/convert/pull_review.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/convert/pull_review.go')
-rw-r--r--modules/convert/pull_review.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/modules/convert/pull_review.go b/modules/convert/pull_review.go
index 418cb711dc..18c6c8e58c 100644
--- a/modules/convert/pull_review.go
+++ b/modules/convert/pull_review.go
@@ -20,14 +20,9 @@ func ToPullReview(r *models.Review, doer *models.User) (*api.PullReview, error)
r.Reviewer = models.NewGhostUser()
}
- auth := false
- if doer != nil {
- auth = doer.IsAdmin || doer.ID == r.ReviewerID
- }
-
result := &api.PullReview{
ID: r.ID,
- Reviewer: ToUser(r.Reviewer, doer != nil, auth),
+ Reviewer: ToUser(r.Reviewer, doer),
ReviewerTeam: ToTeam(r.ReviewerTeam),
State: api.ReviewStateUnknown,
Body: r.Content,
@@ -88,14 +83,10 @@ func ToPullReviewCommentList(review *models.Review, doer *models.User) ([]*api.P
for _, lines := range review.CodeComments {
for _, comments := range lines {
for _, comment := range comments {
- auth := false
- if doer != nil {
- auth = doer.IsAdmin || doer.ID == comment.Poster.ID
- }
apiComment := &api.PullReviewComment{
ID: comment.ID,
Body: comment.Content,
- Reviewer: ToUser(comment.Poster, doer != nil, auth),
+ Reviewer: ToUser(comment.Poster, doer),
ReviewID: review.ID,
Created: comment.CreatedUnix.AsTime(),
Updated: comment.UpdatedUnix.AsTime(),