summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-03-16 04:04:27 -0400
committerUnknwon <u@gogs.io>2015-03-16 04:04:27 -0400
commit588f3215c6c4a82c7ad9cbd2cc6a5683d0ca3cc2 (patch)
tree3c62e7d0e50bf3d4046ecf07fd33063a3d8958ac /routers
parent471b8a18ab73b181b0d6769e2bd95111afd0e9d3 (diff)
downloadgitea-588f3215c6c4a82c7ad9cbd2cc6a5683d0ca3cc2.tar.gz
gitea-588f3215c6c4a82c7ad9cbd2cc6a5683d0ca3cc2.zip
#1040: dashboard no longer accessible when repo is missing
Diffstat (limited to 'routers')
-rw-r--r--routers/org/teams.go2
-rw-r--r--routers/repo/http.go2
-rw-r--r--routers/repo/repo.go4
-rw-r--r--routers/user/home.go2
4 files changed, 5 insertions, 5 deletions
diff --git a/routers/org/teams.go b/routers/org/teams.go
index 69f2734c64..40345cf7c6 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -124,7 +124,7 @@ 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 {
+ if models.IsErrRepoNotExist(err) {
ctx.Flash.Error(ctx.Tr("org.teams.add_nonexistent_repo"))
ctx.Redirect(ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories")
return
diff --git a/routers/repo/http.go b/routers/repo/http.go
index f5dc00b8df..9165128a36 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -65,7 +65,7 @@ func Http(ctx *middleware.Context) {
repo, err := models.GetRepositoryByName(repoUser.Id, reponame)
if err != nil {
- if err == models.ErrRepoNotExist {
+ if models.IsErrRepoNotExist(err) {
ctx.Handle(404, "GetRepositoryByName", nil)
} else {
ctx.Handle(500, "GetRepositoryByName", err)
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 37d07c563f..a70f31e614 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -251,7 +251,7 @@ func Fork(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("new_fork")
if _, err := getForkRepository(ctx); err != nil {
- if err == models.ErrRepoNotExist {
+ if models.IsErrRepoNotExist(err) {
ctx.Redirect(setting.AppSubUrl + "/")
} else {
ctx.Handle(500, "getForkRepository", err)
@@ -275,7 +275,7 @@ func ForkPost(ctx *middleware.Context, form auth.CreateRepoForm) {
forkRepo, err := getForkRepository(ctx)
if err != nil {
- if err == models.ErrRepoNotExist {
+ if models.IsErrRepoNotExist(err) {
ctx.Redirect(setting.AppSubUrl + "/")
} else {
ctx.Handle(500, "getForkRepository", err)
diff --git a/routers/user/home.go b/routers/user/home.go
index 0a1d9dd217..d690b3a7c5 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -354,7 +354,7 @@ func Issues(ctx *middleware.Context) {
issues[i].Repo, err = models.GetRepositoryById(issues[i].RepoId)
if err != nil {
- if err == models.ErrRepoNotExist {
+ if models.IsErrRepoNotExist(err) {
log.Warn("user.Issues(GetRepositoryById #%d): repository not exist", issues[i].RepoId)
continue
} else {