Allow empty assignees on pull request edit (#22150) (#22213)

Backport of #22150

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
tokarchuk/v1.17
KN4CK3R 2 years ago committed by GitHub
parent 7dcf9dd4d8
commit 48450939c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      routers/api/v1/repo/pull.go

@ -488,6 +488,11 @@ func EditPullRequest(ctx *context.APIContext) {
issue := pr.Issue
issue.Repo = ctx.Repo.Repository
if err := issue.LoadAttributes(ctx); err != nil {
ctx.Error(http.StatusInternalServerError, "LoadAttributes", err)
return
}
if !issue.IsPoster(ctx.Doer.ID) && !ctx.Repo.CanWrite(unit.TypePullRequests) {
ctx.Status(http.StatusForbidden)
return

Loading…
Cancel
Save