From f5b70a029c52892d29598a61dce1ea9119db4ae4 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Mon, 8 May 2023 21:19:27 +0900 Subject: [PATCH] Fix close org projects (#24588) A part of #22865 We can not close org projects now. This PR will fix it. --- routers/web/org/projects.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go index 37212179c..32b60e995 100644 --- a/routers/web/org/projects.go +++ b/routers/web/org/projects.go @@ -185,19 +185,19 @@ func ChangeProjectStatus(ctx *context.Context) { case "close": toClose = true default: - ctx.Redirect(ctx.Repo.RepoLink + "/projects") + ctx.Redirect(ctx.ContextUser.HomeLink() + "/-/projects") } 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) { ctx.NotFound("", err) } else { - ctx.ServerError("ChangeProjectStatusByIDAndRepoID", err) + ctx.ServerError("ChangeProjectStatusByRepoIDAndID", err) } 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