Skip to content

Commit

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

user/org project's `RepoID` is always 0, we need to check `OwnerID`
  • Loading branch information
yp05327 authored Mar 9, 2023
1 parent 542cec9 commit 689770c
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 @@ -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
}
Expand Down

0 comments on commit 689770c

Please sign in to comment.