aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2023-05-08 21:19:27 +0900
committerGitHub <noreply@github.com>2023-05-08 12:19:27 +0000
commitf5b70a029c52892d29598a61dce1ea9119db4ae4 (patch)
tree3b8118987cb9545153a00bb0d26b19b96f33893b
parent6f9c278559789066aa831c1df25b0d866103d02d (diff)
downloadgitea-f5b70a029c52892d29598a61dce1ea9119db4ae4.tar.gz
gitea-f5b70a029c52892d29598a61dce1ea9119db4ae4.zip
Fix close org projects (#24588)
A part of #22865 We can not close org projects now. This PR will fix it.
-rw-r--r--routers/web/org/projects.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go
index 37212179c9..32b60e995f 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