0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-29 08:14:06 +01:00

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`
This commit is contained in:
yp05327 2023-03-10 01:59:50 +09:00 committed by GitHub
parent 542cec98f8
commit 689770c928
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}