mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08: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:
		@@ -193,7 +193,7 @@ func DeleteProject(ctx *context.Context) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if p.RepoID != ctx.Repo.Repository.ID {
 | 
						if p.OwnerID != ctx.ContextUser.ID {
 | 
				
			||||||
		ctx.NotFound("", nil)
 | 
							ctx.NotFound("", nil)
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -226,7 +226,7 @@ func EditProject(ctx *context.Context) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if p.RepoID != ctx.Repo.Repository.ID {
 | 
						if p.OwnerID != ctx.ContextUser.ID {
 | 
				
			||||||
		ctx.NotFound("", nil)
 | 
							ctx.NotFound("", nil)
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -261,7 +261,7 @@ func EditProjectPost(ctx *context.Context) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if p.RepoID != ctx.Repo.Repository.ID {
 | 
						if p.OwnerID != ctx.ContextUser.ID {
 | 
				
			||||||
		ctx.NotFound("", nil)
 | 
							ctx.NotFound("", nil)
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user