diff --git a/models/repo/repo_repository.go b/models/repo/repo_repository.go index 2fb5f7484b..74f74c55a0 100644 --- a/models/repo/repo_repository.go +++ b/models/repo/repo_repository.go @@ -24,8 +24,7 @@ func FindFederatedRepoByRepoID(ctx context.Context, repoId int64) ([]*FederatedR return federatedRepoList, sess.Find(&federatedRepoList) } -// ToDo: Name this ...repos -func UpdateFederatedRepo(ctx context.Context, localRepoId int64, federatedRepoList []*FederatedRepo) error { +func StoreFederatedRepos(ctx context.Context, localRepoId int64, federatedRepoList []*FederatedRepo) error { for _, federatedRepo := range federatedRepoList { if res, err := validation.IsValid(*federatedRepo); !res { return fmt.Errorf("FederationInfo is not valid: %v", err) diff --git a/modules/forgefed/federation_service.go b/modules/forgefed/federation_service.go index e4427106cf..99d48673d7 100644 --- a/modules/forgefed/federation_service.go +++ b/modules/forgefed/federation_service.go @@ -212,7 +212,7 @@ func CreateUserFromAP(ctx context.Context, personID forgefed.PersonID, federatio } // Create or update a list of FederatedRepo structs -func UpdateFederatedRepoList(ctx context.Context, localRepoId int64, federatedRepoList []string) (int, string, error) { +func StoreFederatedRepoList(ctx context.Context, localRepoId int64, federatedRepoList []string) (int, string, error) { federatedRepos := make([]*repo.FederatedRepo, 0, len(federatedRepoList)) for _, uri := range federatedRepoList { federationHost, err := GetFederationHostForUri(ctx, uri) @@ -230,7 +230,7 @@ func UpdateFederatedRepoList(ctx context.Context, localRepoId int64, federatedRe federatedRepos = append(federatedRepos, &federatedRepo) } - repo.UpdateFederatedRepo(ctx, localRepoId, federatedRepos) + repo.StoreFederatedRepos(ctx, localRepoId, federatedRepos) return 0, "", nil } diff --git a/routers/web/repo/setting/setting.go b/routers/web/repo/setting/setting.go index de69f45d1d..ab1f10c34a 100644 --- a/routers/web/repo/setting/setting.go +++ b/routers/web/repo/setting/setting.go @@ -204,7 +204,7 @@ func SettingsPost(ctx *context.Context) { return } - if _, _, err := forgefed.UpdateFederatedRepoList(ctx, ctx.Repo.Repository.ID, strings.Split(federationRepos, ";")); err != nil { + if _, _, err := forgefed.StoreFederatedRepoList(ctx, ctx.Repo.Repository.ID, strings.Split(federationRepos, ";")); err != nil { ctx.ServerError("UpdateRepository", err) return }