Alert error message if open dependencies are included in the issues that try to batch close (#24329)

fix #24185 

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
sillyguodong 2023-04-27 00:54:17 +08:00 committed by GitHub
parent df9a62b5f9
commit 8f57aa014b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View file

@ -2689,7 +2689,7 @@ func UpdateIssueStatus(ctx *context.Context) {
if err := issue_service.ChangeStatus(issue, ctx.Doer, "", isClosed); err != nil {
if issues_model.IsErrDependenciesLeft(err) {
ctx.JSON(http.StatusPreconditionFailed, map[string]interface{}{
"error": "cannot close this issue because it still has open dependencies",
"error": ctx.Tr("repo.issues.dependency.issue_batch_close_blocked", issue.Index),
})
return
}