From dedf0790eee151ec0785dd862667deaab00c9966 Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 25 May 2026 15:02:22 +0200 Subject: [PATCH] fix: load attributes before converting to api struct Specifically this load the primary language of the repository. --- services/convert/repository.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/convert/repository.go b/services/convert/repository.go index b95e7675a8..9b8880ecb9 100644 --- a/services/convert/repository.go +++ b/services/convert/repository.go @@ -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 {