diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-07-27 03:59:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-27 09:59:10 +0800 |
commit | a3d55ac52337ecc843a0ff353cde9e5a46b7f463 (patch) | |
tree | 206f1c14eaf3ddb73a75731bb4b6f8c75bad706e /routers/web/repo | |
parent | 5ed082b62491f17c6c91e21f8fe7d544559b0ea1 (diff) | |
download | gitea-a3d55ac52337ecc843a0ff353cde9e5a46b7f463.tar.gz gitea-a3d55ac52337ecc843a0ff353cde9e5a46b7f463.zip |
Hide internal package versions (#20492)
* Hide internal versions from most searches.
* Added test.
Diffstat (limited to 'routers/web/repo')
-rw-r--r-- | routers/web/repo/packages.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/routers/web/repo/packages.go b/routers/web/repo/packages.go index 03ea4fc5f4..d2d31ad57c 100644 --- a/routers/web/repo/packages.go +++ b/routers/web/repo/packages.go @@ -12,6 +12,7 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/modules/util" ) const ( @@ -32,10 +33,11 @@ func Packages(ctx *context.Context) { PageSize: setting.UI.PackagesPagingNum, Page: page, }, - OwnerID: ctx.ContextUser.ID, - RepoID: ctx.Repo.Repository.ID, - Type: packages.Type(packageType), - Name: packages.SearchValue{Value: query}, + OwnerID: ctx.ContextUser.ID, + RepoID: ctx.Repo.Repository.ID, + Type: packages.Type(packageType), + Name: packages.SearchValue{Value: query}, + IsInternal: util.OptionalBoolFalse, }) if err != nil { ctx.ServerError("SearchLatestVersions", err) |