Skip to content

Commit e269e89

Browse files
GiteaBotyp05327
andauthored
Fix incorrect NotFound conditions in org/projects.go (#23384) (#23395)
Backport #23384 A part of #22865 user/org project's `RepoID` is always 0, we need to check `OwnerID` Co-authored-by: yp05327 <576951401@qq.com>
1 parent 87c31c2 commit e269e89

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

routers/web/org/projects.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func DeleteProject(ctx *context.Context) {
193193
}
194194
return
195195
}
196-
if p.RepoID != ctx.Repo.Repository.ID {
196+
if p.OwnerID != ctx.ContextUser.ID {
197197
ctx.NotFound("", nil)
198198
return
199199
}
@@ -226,7 +226,7 @@ func EditProject(ctx *context.Context) {
226226
}
227227
return
228228
}
229-
if p.RepoID != ctx.Repo.Repository.ID {
229+
if p.OwnerID != ctx.ContextUser.ID {
230230
ctx.NotFound("", nil)
231231
return
232232
}
@@ -260,7 +260,7 @@ func EditProjectPost(ctx *context.Context) {
260260
}
261261
return
262262
}
263-
if p.RepoID != ctx.Repo.Repository.ID {
263+
if p.OwnerID != ctx.ContextUser.ID {
264264
ctx.NotFound("", nil)
265265
return
266266
}

0 commit comments

Comments
 (0)