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
…go-gitea#23395)

Backport go-gitea#23384

A part of go-gitea#22865

user/org project's `RepoID` is always 0, we need to check `OwnerID`

Co-authored-by: yp05327 <576951401@qq.com>
  • Loading branch information
GiteaBot and yp05327 authored Mar 9, 2023
1 parent 87c31c2 commit e269e89
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 e269e89

Please sign in to comment.