aboutsummaryrefslogtreecommitdiffstats
path: root/modules/convert/pull_review.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-03-27 17:45:26 +0100
committerGitHub <noreply@github.com>2021-03-27 17:45:26 +0100
commit290cf75f9343a43d9770b1d6f8f3332a23357e27 (patch)
tree520f9f8616fbff3b43a1808ef2d73af3f2fe534b /modules/convert/pull_review.go
parentf4d27498bdc615605e14f783501e1d1256cd8d22 (diff)
downloadgitea-290cf75f9343a43d9770b1d6f8f3332a23357e27.tar.gz
gitea-290cf75f9343a43d9770b1d6f8f3332a23357e27.zip
[refactor] Unify the export of user data via API (#15144)
* [refactor] unify how user data is exported via API * test time via unix timestamp
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(),