Skip to content

Commit f5b70a0

Browse files
authored
Fix close org projects (#24588)
A part of #22865 We can not close org projects now. This PR will fix it.
1 parent 6f9c278 commit f5b70a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

routers/web/org/projects.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,19 @@ func ChangeProjectStatus(ctx *context.Context) {
185185
case "close":
186186
toClose = true
187187
default:
188-
ctx.Redirect(ctx.Repo.RepoLink + "/projects")
188+
ctx.Redirect(ctx.ContextUser.HomeLink() + "/-/projects")
189189
}
190190
id := ctx.ParamsInt64(":id")
191191

192-
if err := project_model.ChangeProjectStatusByRepoIDAndID(ctx.Repo.Repository.ID, id, toClose); err != nil {
192+
if err := project_model.ChangeProjectStatusByRepoIDAndID(0, id, toClose); err != nil {
193193
if project_model.IsErrProjectNotExist(err) {
194194
ctx.NotFound("", err)
195195
} else {
196-
ctx.ServerError("ChangeProjectStatusByIDAndRepoID", err)
196+
ctx.ServerError("ChangeProjectStatusByRepoIDAndID", err)
197197
}
198198
return
199199
}
200-
ctx.Redirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action")))
200+
ctx.Redirect(ctx.ContextUser.HomeLink() + "/-/projects?state=" + url.QueryEscape(ctx.Params(":action")))
201201
}
202202

203203
// DeleteProject delete a project

0 commit comments

Comments
 (0)