|
@@ -522,10 +522,10 @@ func RecommendOrgFromPromote(ctx *context.Context) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
resultOrg := make([]*models.User, 0) |
|
|
resultOrg := make([]*models.User, 0) |
|
|
for i, userName := range result { |
|
|
|
|
|
|
|
|
for _, userName := range result { |
|
|
user, err := models.GetUserByName(userName) |
|
|
user, err := models.GetUserByName(userName) |
|
|
if err == nil { |
|
|
if err == nil { |
|
|
resultOrg[i] = user |
|
|
|
|
|
|
|
|
resultOrg = append(resultOrg, user) |
|
|
} else { |
|
|
} else { |
|
|
log.Info("query user error," + err.Error()) |
|
|
log.Info("query user error," + err.Error()) |
|
|
} |
|
|
} |
|
@@ -570,7 +570,7 @@ func RecommendRepoFromPromote(ctx *context.Context) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
resultRepo := make([]*models.Repository, 0) |
|
|
resultRepo := make([]*models.Repository, 0) |
|
|
for i, repoName := range result { |
|
|
|
|
|
|
|
|
for _, repoName := range result { |
|
|
tmpIndex := strings.Index(repoName, ".") |
|
|
tmpIndex := strings.Index(repoName, ".") |
|
|
if tmpIndex == -1 { |
|
|
if tmpIndex == -1 { |
|
|
log.Info("error repo name format.") |
|
|
log.Info("error repo name format.") |
|
@@ -579,7 +579,7 @@ func RecommendRepoFromPromote(ctx *context.Context) { |
|
|
repoName := strings.Trim(repoName[tmpIndex+1:], " ") |
|
|
repoName := strings.Trim(repoName[tmpIndex+1:], " ") |
|
|
repo, err := models.GetRepositoryByOwnerAndName(ownerName, repoName) |
|
|
repo, err := models.GetRepositoryByOwnerAndName(ownerName, repoName) |
|
|
if err == nil { |
|
|
if err == nil { |
|
|
resultRepo[i] = repo |
|
|
|
|
|
|
|
|
resultRepo = append(resultRepo, repo) |
|
|
} else { |
|
|
} else { |
|
|
log.Info("query repo error," + err.Error()) |
|
|
log.Info("query repo error," + err.Error()) |
|
|
} |
|
|
} |
|
|