Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Dec 3, 2024
1 parent 48d141a commit 8ce062b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions routers/api/v1/org/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,14 +578,14 @@ func GetTeamRepos(ctx *context.APIContext) {
TeamID: team.ID,
})
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetTeamRepos", err)
ctx.Error(http.StatusInternalServerError, "GetTeamRepositories", err)
return
}
repos := make([]*api.Repository, len(teamRepos))
for i, repo := range teamRepos {
permission, err := access_model.GetUserRepoPermission(ctx, repo, ctx.Doer)
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetTeamRepos", err)
ctx.Error(http.StatusInternalServerError, "GetUserRepoPermission", err)
return
}
repos[i] = convert.ToRepo(ctx, repo, permission)
Expand Down
2 changes: 1 addition & 1 deletion routers/web/org/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func TeamRepositories(ctx *context.Context) {
TeamID: ctx.Org.Team.ID,
})
if err != nil {
ctx.ServerError("GetRepositories", err)
ctx.ServerError("GetTeamRepositories", err)
return
}
ctx.Data["Units"] = unit_model.Units
Expand Down
4 changes: 2 additions & 2 deletions services/org/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func UpdateTeam(ctx context.Context, t *organization.Team, authChanged, includeA
TeamID: t.ID,
})
if err != nil {
return fmt.Errorf("LoadRepositories: %w", err)
return fmt.Errorf("GetTeamRepositories: %w", err)
}

for _, repo := range repos {
Expand Down Expand Up @@ -304,7 +304,7 @@ func AddTeamMember(ctx context.Context, team *organization.Team, user *user_mode
TeamID: team.ID,
})
if err != nil {
log.Error("team.LoadRepositories failed: %v", err)
log.Error("GetTeamRepositories failed: %v", err)
}

// FIXME: in the goroutine, it can't access the "ctx", it could only use db.DefaultContext at the moment
Expand Down
2 changes: 1 addition & 1 deletion services/org/team_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func TestIncludesAllRepositoriesTeams(t *testing.T) {
repos, err := repo_model.GetTeamRepositories(db.DefaultContext, &repo_model.SearchTeamRepoOptions{
TeamID: team.ID,
})
assert.NoError(t, err, "%s: GetRepositories", team.Name)
assert.NoError(t, err, "%s: GetTeamRepositories", team.Name)
assert.Len(t, repos, team.NumRepos, "%s: len repo", team.Name)
assert.Len(t, repos, len(repoIDs), "%s: repo count", team.Name)
for i, rid := range repoIDs {
Expand Down

0 comments on commit 8ce062b

Please sign in to comment.