summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-12-14 19:38:15 +0100
committerGitHub <noreply@github.com>2022-12-14 13:38:15 -0500
commit9e49270676f4c38e5bff3679ddbca6a92f6325e0 (patch)
tree63b1f639a1366b0efa9424d10386d3c1a3edf535 /models
parent194b780cd7f943d5155faf026223f4d7ff764daa (diff)
downloadgitea-9e49270676f4c38e5bff3679ddbca6a92f6325e0.tar.gz
gitea-9e49270676f4c38e5bff3679ddbca6a92f6325e0.zip
Fix condition for is_internal (#22095) (#22132)
Backport of #22095 I changed it to a static condition because it needs a new version of xorm which is only available in 1.19. This change is valid because `SearchLatestVersions` is never called to list internal versions and there will no change to this behaviour in <1.19. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'models')
-rw-r--r--models/packages/package_version.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/packages/package_version.go b/models/packages/package_version.go
index f9965bcb74..4b2a6f84c3 100644
--- a/models/packages/package_version.go
+++ b/models/packages/package_version.go
@@ -305,7 +305,7 @@ func SearchLatestVersions(ctx context.Context, opts *PackageSearchOptions) ([]*P
sess := db.GetEngine(ctx).
Table("package_version").
- Join("LEFT", "package_version pv2", "package_version.package_id = pv2.package_id AND (package_version.created_unix < pv2.created_unix OR (package_version.created_unix = pv2.created_unix AND package_version.id < pv2.id))").
+ Join("LEFT", "package_version pv2", "package_version.package_id = pv2.package_id AND pv2.is_internal = ? AND (package_version.created_unix < pv2.created_unix OR (package_version.created_unix = pv2.created_unix AND package_version.id < pv2.id))", false).
Join("INNER", "package", "package.id = package_version.package_id").
Where(cond)