aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/org
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2023-03-10 01:59:50 +0900
committerGitHub <noreply@github.com>2023-03-09 10:59:50 -0600
commit689770c928ed46725e72ddaa2e988c52e44c2975 (patch)
tree82821f1ee5f0f9b9f1afab33c7f4abd09227546b /routers/web/org
parent542cec98f8c07e0f046a35f1d516807416536e74 (diff)
downloadgitea-689770c928ed46725e72ddaa2e988c52e44c2975.tar.gz
gitea-689770c928ed46725e72ddaa2e988c52e44c2975.zip
Fix incorrect NotFound conditions in org/projects.go (#23384)
A part of https://github.com/go-gitea/gitea/pull/22865 user/org project's `RepoID` is always 0, we need to check `OwnerID`
Diffstat (limited to 'routers/web/org')
-rw-r--r--routers/web/org/projects.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go
index 7b5eef32d8..17919b7c4d 100644
--- a/routers/web/org/projects.go
+++ b/routers/web/org/projects.go
@@ -193,7 +193,7 @@ func DeleteProject(ctx *context.Context) {
}
return
}
- if p.RepoID != ctx.Repo.Repository.ID {
+ if p.OwnerID != ctx.ContextUser.ID {
ctx.NotFound("", nil)
return
}
@@ -226,7 +226,7 @@ func EditProject(ctx *context.Context) {
}
return
}
- if p.RepoID != ctx.Repo.Repository.ID {
+ if p.OwnerID != ctx.ContextUser.ID {
ctx.NotFound("", nil)
return
}
@@ -261,7 +261,7 @@ func EditProjectPost(ctx *context.Context) {
}
return
}
- if p.RepoID != ctx.Repo.Repository.ID {
+ if p.OwnerID != ctx.ContextUser.ID {
ctx.NotFound("", nil)
return
}