|
|
@ -5,6 +5,7 @@ package packages |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"context" |
|
|
|
|
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"net/url" |
|
|
|
"net/url" |
|
|
|
|
|
|
|
|
|
|
@ -25,6 +26,7 @@ import ( |
|
|
|
"code.gitea.io/gitea/modules/packages/pypi" |
|
|
|
"code.gitea.io/gitea/modules/packages/pypi" |
|
|
|
"code.gitea.io/gitea/modules/packages/rubygems" |
|
|
|
"code.gitea.io/gitea/modules/packages/rubygems" |
|
|
|
"code.gitea.io/gitea/modules/packages/vagrant" |
|
|
|
"code.gitea.io/gitea/modules/packages/vagrant" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/util" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/go-version" |
|
|
|
"github.com/hashicorp/go-version" |
|
|
|
) |
|
|
|
) |
|
|
@ -98,7 +100,11 @@ func GetPackageDescriptor(ctx context.Context, pv *PackageVersion) (*PackageDesc |
|
|
|
} |
|
|
|
} |
|
|
|
creator, err := user_model.GetUserByID(ctx, pv.CreatorID) |
|
|
|
creator, err := user_model.GetUserByID(ctx, pv.CreatorID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
if errors.Is(err, util.ErrNotExist) { |
|
|
|
|
|
|
|
creator = user_model.NewGhostUser() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return nil, err |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
var semVer *version.Version |
|
|
|
var semVer *version.Version |
|
|
|
if p.SemverCompatible { |
|
|
|
if p.SemverCompatible { |
|
|
|