summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-07-27 03:59:10 +0200
committerGitHub <noreply@github.com>2022-07-27 09:59:10 +0800
commita3d55ac52337ecc843a0ff353cde9e5a46b7f463 (patch)
tree206f1c14eaf3ddb73a75731bb4b6f8c75bad706e /models
parent5ed082b62491f17c6c91e21f8fe7d544559b0ea1 (diff)
downloadgitea-a3d55ac52337ecc843a0ff353cde9e5a46b7f463.tar.gz
gitea-a3d55ac52337ecc843a0ff353cde9e5a46b7f463.zip
Hide internal package versions (#20492)
* Hide internal versions from most searches. * Added test.
Diffstat (limited to 'models')
-rw-r--r--models/packages/package_version.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/models/packages/package_version.go b/models/packages/package_version.go
index 83c2fdb674..5479bae1c2 100644
--- a/models/packages/package_version.go
+++ b/models/packages/package_version.go
@@ -122,8 +122,9 @@ func getVersionByNameAndVersion(ctx context.Context, ownerID int64, packageType
// GetVersionsByPackageType gets all versions of a specific type
func GetVersionsByPackageType(ctx context.Context, ownerID int64, packageType Type) ([]*PackageVersion, error) {
pvs, _, err := SearchVersions(ctx, &PackageSearchOptions{
- OwnerID: ownerID,
- Type: packageType,
+ OwnerID: ownerID,
+ Type: packageType,
+ IsInternal: util.OptionalBoolFalse,
})
return pvs, err
}
@@ -137,6 +138,7 @@ func GetVersionsByPackageName(ctx context.Context, ownerID int64, packageType Ty
ExactMatch: true,
Value: name,
},
+ IsInternal: util.OptionalBoolFalse,
})
return pvs, err
}