Skip to content

Commit 6f323d1

Browse files
KN4CK3Rlunnytechknowlogick
authored
Fix condition for is_internal (#22095) (#22131)
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>
1 parent 0e95e74 commit 6f323d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/packages/package_version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func SearchLatestVersions(ctx context.Context, opts *PackageSearchOptions) ([]*P
289289

290290
sess := db.GetEngine(ctx).
291291
Table("package_version").
292-
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))").
292+
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).
293293
Join("INNER", "package", "package.id = package_version.package_id").
294294
Where(cond)
295295

0 commit comments

Comments
 (0)