Skip to content

Commit

Permalink
Fix incorrect NotFound conditions in org/projects.go (go-gitea#23384)
Browse files Browse the repository at this point in the history
A part of go-gitea#22865

user/org project's `RepoID` is always 0, we need to check `OwnerID`
  • Loading branch information
yp05327 authored and GiteaBot committed Mar 9, 2023
1 parent 87c31c2 commit ffe0d43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions routers/web/org/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -260,7 +260,7 @@ func EditProjectPost(ctx *context.Context) {
}
return
}
if p.RepoID != ctx.Repo.Repository.ID {
if p.OwnerID != ctx.ContextUser.ID {
ctx.NotFound("", nil)
return
}
Expand Down

0 comments on commit ffe0d43

Please sign in to comment.