forked from p85947160/gitea
Issue: Show error prompt when add repository to team and it does not exist #533
This commit is contained in:
parent
c31606daf9
commit
85c9f7c5f3
|
@ -408,6 +408,7 @@ teams.admin_permission_desc = This team grants <strong>Admin</strong> access: me
|
|||
teams.repositories = Team Repositories
|
||||
teams.add_team_repository = Add Team Repository
|
||||
teams.remove_repo = Remove
|
||||
teams.add_nonexistent_repo = The repository you're trying to add does not exist, please create it first.
|
||||
|
||||
[admin]
|
||||
dashboard = Dashboard
|
||||
|
|
|
@ -408,6 +408,7 @@ teams.admin_permission_desc = 该团队拥有一定的 <strong>管理</strong>
|
|||
teams.repositories = 团队仓库
|
||||
teams.add_team_repository = 添加团队仓库
|
||||
teams.remove_repo = 移除仓库
|
||||
teams.add_nonexistent_repo = 您尝试添加到团队的仓库不存在,请先创建仓库!
|
||||
|
||||
[admin]
|
||||
dashboard = 控制面板
|
||||
|
|
|
@ -124,6 +124,11 @@ func TeamsRepoAction(ctx *middleware.Context) {
|
|||
var repo *models.Repository
|
||||
repo, err = models.GetRepositoryByName(ctx.Org.Organization.Id, repoName)
|
||||
if err != nil {
|
||||
if err == models.ErrRepoNotExist {
|
||||
ctx.Flash.Error(ctx.Tr("org.teams.add_nonexistent_repo"))
|
||||
ctx.Redirect(ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories")
|
||||
return
|
||||
}
|
||||
ctx.Handle(500, "GetRepositoryByName", err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue