mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-23 11:59:24 +00:00
fix: ignore errors when loading data for converting project to response
This commit is contained in:
parent
fec855e323
commit
6238b9e746
@ -22,10 +22,7 @@ func ToAPIProject(ctx context.Context, project *project_model.Project) (*api.Pro
|
|||||||
}
|
}
|
||||||
|
|
||||||
// try to laod the repo
|
// try to laod the repo
|
||||||
err := project.LoadRepo(ctx)
|
_ = project.LoadRepo(ctx)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if project.Repo != nil {
|
if project.Repo != nil {
|
||||||
apiProject.Repo = &api.RepositoryMeta{
|
apiProject.Repo = &api.RepositoryMeta{
|
||||||
ID: project.RepoID,
|
ID: project.RepoID,
|
||||||
@ -35,10 +32,7 @@ func ToAPIProject(ctx context.Context, project *project_model.Project) (*api.Pro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = project.LoadCreator(ctx)
|
_ = project.LoadCreator(ctx)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if project.Creator != nil {
|
if project.Creator != nil {
|
||||||
apiProject.Creator = &api.User{
|
apiProject.Creator = &api.User{
|
||||||
ID: project.Creator.ID,
|
ID: project.Creator.ID,
|
||||||
@ -47,10 +41,7 @@ func ToAPIProject(ctx context.Context, project *project_model.Project) (*api.Pro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = project.LoadOwner(ctx)
|
_ = project.LoadOwner(ctx)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if project.Owner != nil {
|
if project.Owner != nil {
|
||||||
apiProject.Owner = &api.User{
|
apiProject.Owner = &api.User{
|
||||||
ID: project.Owner.ID,
|
ID: project.Owner.ID,
|
||||||
|
Loading…
Reference in New Issue
Block a user