From 62c33f92a9c56753b87c92da38642ae7641e5540 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 15 Oct 2023 18:08:01 +0800 Subject: [PATCH] Fix 404 when deleting Docker package with an internal version (#27615) (#27629) Backport #27615 by @lng2020 close #27601 The Docker registry has an internal version, which leads to 404 Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com> (cherry picked from commit 171950a0d45745743d519aeb547b2a93cfb6410d) --- routers/web/user/package.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/user/package.go b/routers/web/user/package.go index 20141914b6..20bb3552fa 100644 --- a/routers/web/user/package.go +++ b/routers/web/user/package.go @@ -422,7 +422,7 @@ func PackageSettingsPost(ctx *context.Context) { redirectURL := ctx.Package.Owner.HomeLink() + "/-/packages" // redirect to the package if there are still versions available - if has, _ := packages_model.ExistVersion(ctx, &packages_model.PackageSearchOptions{PackageID: ctx.Package.Descriptor.Package.ID}); has { + if has, _ := packages_model.ExistVersion(ctx, &packages_model.PackageSearchOptions{PackageID: ctx.Package.Descriptor.Package.ID, IsInternal: util.OptionalBoolFalse}); has { redirectURL = ctx.Package.Descriptor.PackageWebLink() }