Issue: Show error prompt when add repository to team and it does not exist #533
This commit is contained in:
parent
c31606daf9
commit
85c9f7c5f3
3 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue