fix: load attributes before converting to api struct

Specifically this load the primary language of the repository.
This commit is contained in:
Gusted 2026-05-25 15:02:22 +02:00
parent e30d4ef5da
commit dedf0790ee
No known key found for this signature in database
GPG key ID: FD821B732837125F

View file

@ -24,6 +24,10 @@ func ToRepo(ctx stdCtx.Context, repo *repo_model.Repository, permissionInRepo ac
}
func innerToRepo(ctx stdCtx.Context, repo *repo_model.Repository, permissionInRepo access_model.Permission, isParent bool) *api.Repository {
if err := repo.LoadAttributes(ctx); err != nil {
log.Error("Unable to load attributes for repo[id=%d]: %w", repo.ID, err)
}
var parent *api.Repository
if permissionInRepo.Units == nil && permissionInRepo.UnitsMode == nil {