diff --git a/routers/org/teams.go b/routers/org/teams.go index 03fbf068d..5fc0edbdd 100644 --- a/routers/org/teams.go +++ b/routers/org/teams.go @@ -143,7 +143,7 @@ func TeamsRepoAction(ctx *context.Context) { case "add": repoName := path.Base(ctx.Query("repo_name")) var repo *models.Repository - repo, err = models.GetRepositoryByName(ctx.Org.Organization.ID, repoName) + repo, err = models.GetRepositoryByOwnerAndAlias(ctx.Org.Organization.Name, repoName) if err != nil { if models.IsErrRepoNotExist(err) { ctx.Flash.Error(ctx.Tr("org.teams.add_nonexistent_repo"))