Skip to content

Commit b390b43

Browse files
GiteaBotyp05327
andauthored
Fix close org projects (#24588) (#24591)
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>
1 parent 306b7b5 commit b390b43

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

routers/web/org/projects.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,19 @@ func ChangeProjectStatus(ctx *context.Context) {
172172
case "close":
173173
toClose = true
174174
default:
175-
ctx.Redirect(ctx.Repo.RepoLink + "/projects")
175+
ctx.Redirect(ctx.ContextUser.HomeLink() + "/-/projects")
176176
}
177177
id := ctx.ParamsInt64(":id")
178178

179-
if err := project_model.ChangeProjectStatusByRepoIDAndID(ctx.Repo.Repository.ID, id, toClose); err != nil {
179+
if err := project_model.ChangeProjectStatusByRepoIDAndID(0, id, toClose); err != nil {
180180
if project_model.IsErrProjectNotExist(err) {
181181
ctx.NotFound("", err)
182182
} else {
183-
ctx.ServerError("ChangeProjectStatusByIDAndRepoID", err)
183+
ctx.ServerError("ChangeProjectStatusByRepoIDAndID", err)
184184
}
185185
return
186186
}
187-
ctx.Redirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action")))
187+
ctx.Redirect(ctx.ContextUser.HomeLink() + "/-/projects?state=" + url.QueryEscape(ctx.Params(":action")))
188188
}
189189

190190
// DeleteProject delete a project

0 commit comments

Comments
 (0)