Fix 500 error when state params is set when editing issue/PR by API (#31880) (#31952)

Backport #31880 by @yp05327

A quick fix for #31871

Co-authored-by: yp05327 <576951401@qq.com>
This commit is contained in:
Giteabot
2024-09-02 02:38:10 +08:00
committed by GitHub
parent 0de69c26ec
commit b5500cded1
3 changed files with 41 additions and 10 deletions

View File

@@ -13,6 +13,9 @@ import (
)
// ChangeStatus changes issue status to open or closed.
// closed means the target status
// Fix me: you should check whether the current issue status is same to the target status before call this function
// as in function changeIssueStatus we will return WasClosedError, even the issue status and target status are both open
func ChangeStatus(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, commitID string, closed bool) error {
comment, err := issues_model.ChangeIssueStatus(ctx, issue, doer, closed)
if err != nil {