diff options
author | Unknwon <u@gogs.io> | 2015-08-05 20:26:00 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-05 20:26:00 +0800 |
commit | 2c507667bfd17f88dc4bfabc426c74cd5f8e4461 (patch) | |
tree | 31b267331f84d45a92f6a0bfe7eaafa124f4578f /routers/repo | |
parent | 0705f55ce097b9892a7c4c11faa5396c4e557232 (diff) | |
parent | b9527cd1bfabcce3be62b43f0c199b1418519549 (diff) | |
download | gitea-2c507667bfd17f88dc4bfabc426c74cd5f8e4461.tar.gz gitea-2c507667bfd17f88dc4bfabc426c74cd5f8e4461.zip |
Merge branch 'develop' of github.com:gogits/gogs into feature/milestone
# Conflicts:
# gogs.go
# models/issue.go
# templates/.VERSION
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/http.go | 4 | ||||
-rw-r--r-- | routers/repo/repo.go | 2 | ||||
-rw-r--r-- | routers/repo/setting.go | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go index 4e5aba04e0..45b0ec59c9 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -55,7 +55,7 @@ func Http(ctx *middleware.Context) { repoUser, err := models.GetUserByName(username) if err != nil { - if err == models.ErrUserNotExist { + if models.IsErrUserNotExist(err) { ctx.Handle(404, "GetUserByName", nil) } else { ctx.Handle(500, "GetUserByName", err) @@ -107,7 +107,7 @@ func Http(ctx *middleware.Context) { authUser, err = models.UserSignIn(authUsername, authPasswd) if err != nil { - if err != models.ErrUserNotExist { + if !models.IsErrUserNotExist(err) { ctx.Handle(500, "UserSignIn error: %v", err) return } diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 605071d110..f8df726cb6 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -35,7 +35,7 @@ func checkContextUser(ctx *middleware.Context, uid int64) *models.User { } org, err := models.GetUserById(uid) - if err == models.ErrUserNotExist { + if models.IsErrUserNotExist(err) { return ctx.User } diff --git a/routers/repo/setting.go b/routers/repo/setting.go index c371480816..12fc428c1d 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -118,7 +118,7 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) { } if _, err = models.UserSignIn(ctx.User.Name, ctx.Query("password")); err != nil { - if err == models.ErrUserNotExist { + if models.IsErrUserNotExist(err) { ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_password"), SETTINGS_OPTIONS, nil) } else { ctx.Handle(500, "UserSignIn", err) @@ -151,7 +151,7 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) { } if _, err := models.UserSignIn(ctx.User.Name, ctx.Query("password")); err != nil { - if err == models.ErrUserNotExist { + if models.IsErrUserNotExist(err) { ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_password"), SETTINGS_OPTIONS, nil) } else { ctx.Handle(500, "UserSignIn", err) @@ -185,7 +185,7 @@ func SettingsCollaboration(ctx *middleware.Context) { u, err := models.GetUserByName(name) if err != nil { - if err == models.ErrUserNotExist { + if models.IsErrUserNotExist(err) { ctx.Flash.Error(ctx.Tr("form.user_not_exist")) ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path) } else { |