error: move ErrRepoNotExist -> errors.RepoNotExist

This commit is contained in:
Unknwon
2017-03-23 14:27:34 -04:00
parent 902372067c
commit beee6e03b1
13 changed files with 35 additions and 32 deletions

View File

@@ -6,13 +6,14 @@ package admin
import (
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/models/errors"
"github.com/gogits/gogs/modules/context"
)
func GetRepositoryByParams(ctx *context.APIContext) *models.Repository {
repo, err := models.GetRepositoryByName(ctx.Org.Team.OrgID, ctx.Params(":reponame"))
if err != nil {
if models.IsErrRepoNotExist(err) {
if errors.IsRepoNotExist(err) {
ctx.Status(404)
} else {
ctx.Error(500, "GetRepositoryByName", err)