diff options
author | Jason Song <i@wolfogre.com> | 2022-09-10 01:27:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 18:27:47 +0100 |
commit | 831e981357dc24e45383b7d495227011a7b8f23e (patch) | |
tree | 0cba2e0c97e51d144ba3c48650cb43252bb9e722 /routers/web/repo | |
parent | b5d21c0adf38a4726b14157786be8ad11c1eda22 (diff) | |
download | gitea-831e981357dc24e45383b7d495227011a7b8f23e.tar.gz gitea-831e981357dc24e45383b7d495227011a7b8f23e.zip |
Allow poster to choose reviewers (#21084)
Allow the poster of a PR to choose reviewers (add only).
Solve #20746
Diffstat (limited to 'routers/web/repo')
-rw-r--r-- | routers/web/repo/issue.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 592f7eac8f..5dab770d55 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -1336,11 +1336,16 @@ func ViewIssue(ctx *context.Context) { if issue.IsPull { canChooseReviewer := ctx.Repo.CanWrite(unit.TypePullRequests) - if !canChooseReviewer && ctx.Doer != nil && ctx.IsSigned { - canChooseReviewer, err = issues_model.IsOfficialReviewer(ctx, issue, ctx.Doer) - if err != nil { - ctx.ServerError("IsOfficialReviewer", err) - return + if ctx.Doer != nil && ctx.IsSigned { + if !canChooseReviewer { + canChooseReviewer = ctx.Doer.ID == issue.PosterID + } + if !canChooseReviewer { + canChooseReviewer, err = issues_model.IsOfficialReviewer(ctx, issue, ctx.Doer) + if err != nil { + ctx.ServerError("IsOfficialReviewer", err) + return + } } } |