allow anonymous SSH clone

This commit is contained in:
Unknwon 2015-08-05 11:14:17 +08:00
parent 487fc8ca39
commit e50982f5ec
20 changed files with 109 additions and 92 deletions

View file

@ -61,7 +61,7 @@ func SearchUsers(ctx *middleware.Context) {
func GetUserInfo(ctx *middleware.Context) {
u, err := models.GetUserByName(ctx.Params(":username"))
if err != nil {
if err == models.ErrUserNotExist {
if models.IsErrUserNotExist(err) {
ctx.Error(404)
} else {
ctx.JSON(500, &base.ApiJsonErr{"GetUserByName: " + err.Error(), base.DOC_URL})