Fix repo API bug (#2133)

Don't require token when not necessary
This commit is contained in:
Ethan Koenig
2017-07-11 21:23:41 -04:00
committed by Kim "BKC" Carlbäcker
parent da89afda58
commit 93a1de4842
9 changed files with 132 additions and 54 deletions

View File

@ -267,13 +267,7 @@ func Get(ctx *context.APIContext) {
// 200: Repository
// 500: error
repo := ctx.Repo.Repository
access, err := models.AccessLevel(ctx.User.ID, repo)
if err != nil {
ctx.Error(500, "GetRepository", err)
return
}
ctx.JSON(200, repo.APIFormat(access))
ctx.JSON(200, ctx.Repo.Repository.APIFormat(ctx.Repo.AccessMode))
}
// GetByID returns a single Repository