From b76718249ab39b4d6502e373c09b50989389157a Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Wed, 21 Dec 2022 23:45:44 +0100 Subject: [PATCH] Allow empty assignees on pull request edit (#22150) Fixes #22140 --- routers/api/v1/repo/pull.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index 1246ede9e6d7..ed23b267f287 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -490,6 +490,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