forked from gitea/gitea
Backport #24588 by @yp05327 A part of #22865 We can not close org projects now. This PR will fix it. Co-authored-by: yp05327 <576951401@qq.com>
This commit is contained in:
parent
306b7b5d1d
commit
b390b439e1
|
@ -172,19 +172,19 @@ func ChangeProjectStatus(ctx *context.Context) {
|
||||||
case "close":
|
case "close":
|
||||||
toClose = true
|
toClose = true
|
||||||
default:
|
default:
|
||||||
ctx.Redirect(ctx.Repo.RepoLink + "/projects")
|
ctx.Redirect(ctx.ContextUser.HomeLink() + "/-/projects")
|
||||||
}
|
}
|
||||||
id := ctx.ParamsInt64(":id")
|
id := ctx.ParamsInt64(":id")
|
||||||
|
|
||||||
if err := project_model.ChangeProjectStatusByRepoIDAndID(ctx.Repo.Repository.ID, id, toClose); err != nil {
|
if err := project_model.ChangeProjectStatusByRepoIDAndID(0, id, toClose); err != nil {
|
||||||
if project_model.IsErrProjectNotExist(err) {
|
if project_model.IsErrProjectNotExist(err) {
|
||||||
ctx.NotFound("", err)
|
ctx.NotFound("", err)
|
||||||
} else {
|
} else {
|
||||||
ctx.ServerError("ChangeProjectStatusByIDAndRepoID", err)
|
ctx.ServerError("ChangeProjectStatusByRepoIDAndID", err)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ctx.Redirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action")))
|
ctx.Redirect(ctx.ContextUser.HomeLink() + "/-/projects?state=" + url.QueryEscape(ctx.Params(":action")))
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteProject delete a project
|
// DeleteProject delete a project
|
||||||
|
|
Loading…
Reference in New Issue