diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-03-22 08:03:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-22 15:03:22 +0800 |
commit | 80fd25524e13dedbdc3527b32d008de152213a89 (patch) | |
tree | 63b2bfe4ffaf1dce12080cabdc2e845c8731a673 /routers/web/repo/pull_review.go | |
parent | 5495ba7660979973ba19e304786135da474e0e64 (diff) | |
download | gitea-80fd25524e13dedbdc3527b32d008de152213a89.tar.gz gitea-80fd25524e13dedbdc3527b32d008de152213a89.zip |
Renamed ctx.User to ctx.Doer. (#19161)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/web/repo/pull_review.go')
-rw-r--r-- | routers/web/repo/pull_review.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/routers/web/repo/pull_review.go b/routers/web/repo/pull_review.go index c92f08a88a..939b0037a0 100644 --- a/routers/web/repo/pull_review.go +++ b/routers/web/repo/pull_review.go @@ -29,7 +29,7 @@ func RenderNewCodeCommentForm(ctx *context.Context) { if !issue.IsPull { return } - currentReview, err := models.GetCurrentReview(ctx.User, issue) + currentReview, err := models.GetCurrentReview(ctx.Doer, issue) if err != nil && !models.IsErrReviewNotExist(err) { ctx.ServerError("GetCurrentReview", err) return @@ -69,7 +69,7 @@ func CreateCodeComment(ctx *context.Context) { } comment, err := pull_service.CreateCodeComment(ctx, - ctx.User, + ctx.Doer, ctx.Repo.GitRepo, issue, signedLine, @@ -117,7 +117,7 @@ func UpdateResolveConversation(ctx *context.Context) { } var permResult bool - if permResult, err = models.CanMarkConversation(comment.Issue, ctx.User); err != nil { + if permResult, err = models.CanMarkConversation(comment.Issue, ctx.Doer); err != nil { ctx.ServerError("CanMarkConversation", err) return } @@ -132,7 +132,7 @@ func UpdateResolveConversation(ctx *context.Context) { } if action == "Resolve" || action == "UnResolve" { - err = models.MarkConversation(comment, ctx.User, action == "Resolve") + err = models.MarkConversation(comment, ctx.Doer, action == "Resolve") if err != nil { ctx.ServerError("MarkConversation", err) return @@ -152,7 +152,7 @@ func UpdateResolveConversation(ctx *context.Context) { } func renderConversation(ctx *context.Context, comment *models.Comment) { - comments, err := models.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.User, comment.TreePath, comment.Line) + comments, err := models.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line) if err != nil { ctx.ServerError("FetchCodeCommentsByLine", err) return @@ -198,7 +198,7 @@ func SubmitReview(ctx *context.Context) { // can not approve/reject your own PR case models.ReviewTypeApprove, models.ReviewTypeReject: - if issue.IsPoster(ctx.User.ID) { + if issue.IsPoster(ctx.Doer.ID) { var translated string if reviewType == models.ReviewTypeApprove { translated = ctx.Tr("repo.issues.review.self.approval") @@ -217,7 +217,7 @@ func SubmitReview(ctx *context.Context) { attachments = form.Files } - _, comm, err := pull_service.SubmitReview(ctx, ctx.User, ctx.Repo.GitRepo, issue, reviewType, form.Content, form.CommitID, attachments) + _, comm, err := pull_service.SubmitReview(ctx, ctx.Doer, ctx.Repo.GitRepo, issue, reviewType, form.Content, form.CommitID, attachments) if err != nil { if models.IsContentEmptyErr(err) { ctx.Flash.Error(ctx.Tr("repo.issues.review.content.empty")) @@ -234,7 +234,7 @@ func SubmitReview(ctx *context.Context) { // DismissReview dismissing stale review by repo admin func DismissReview(ctx *context.Context) { form := web.GetForm(ctx).(*forms.DismissReviewForm) - comm, err := pull_service.DismissReview(ctx, form.ReviewID, form.Message, ctx.User, true) + comm, err := pull_service.DismissReview(ctx, form.ReviewID, form.Message, ctx.Doer, true) if err != nil { ctx.ServerError("pull_service.DismissReview", err) return |