summaryrefslogtreecommitdiffstats
path: root/routers/org
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-10-10 05:06:12 -0400
committerUnknwon <joe2010xtmf@163.com>2014-10-10 05:06:12 -0400
commit85c9f7c5f354838fc8a78977a80f9899b5158897 (patch)
tree5088d78e9bfa2fc528b7a153a801facd2a329f91 /routers/org
parentc31606daf9209dd3583602b529a84b4608c46172 (diff)
downloadgitea-85c9f7c5f354838fc8a78977a80f9899b5158897.tar.gz
gitea-85c9f7c5f354838fc8a78977a80f9899b5158897.zip
Issue: Show error prompt when add repository to team and it does not exist #533
Diffstat (limited to 'routers/org')
-rw-r--r--routers/org/teams.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/org/teams.go b/routers/org/teams.go
index 9aa8e50214..77a7b6e13c 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -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
}