summaryrefslogtreecommitdiffstats
path: root/models/login_source.go
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-10-04 21:43:04 -0700
committerLauris BH <lauris@nix.lv>2017-10-05 07:43:04 +0300
commitaa962deec037375a7cfae3b96094becdfe48e778 (patch)
treeb4322667ac85dd945c0a6aa65c96ba4fa9b96654 /models/login_source.go
parente1266a19c847600aceee6f16875e0384c7c0f736 (diff)
downloadgitea-aa962deec037375a7cfae3b96094becdfe48e778.tar.gz
gitea-aa962deec037375a7cfae3b96094becdfe48e778.zip
Replace deprecated Id method with ID (#2655)
Diffstat (limited to 'models/login_source.go')
-rw-r--r--models/login_source.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/models/login_source.go b/models/login_source.go
index caf1a1dd4f..9fb056ee53 100644
--- a/models/login_source.go
+++ b/models/login_source.go
@@ -308,7 +308,7 @@ func LoginSources() ([]*LoginSource, error) {
// GetLoginSourceByID returns login source by given ID.
func GetLoginSourceByID(id int64) (*LoginSource, error) {
source := new(LoginSource)
- has, err := x.Id(id).Get(source)
+ has, err := x.ID(id).Get(source)
if err != nil {
return nil, err
} else if !has {
@@ -328,7 +328,7 @@ func UpdateSource(source *LoginSource) error {
}
}
- _, err := x.Id(source.ID).AllCols().Update(source)
+ _, err := x.ID(source.ID).AllCols().Update(source)
if err == nil && source.IsOAuth2() && source.IsActived {
oAuth2Config := source.OAuth2()
err = oauth2.RegisterProvider(source.Name, oAuth2Config.Provider, oAuth2Config.ClientID, oAuth2Config.ClientSecret, oAuth2Config.OpenIDConnectAutoDiscoveryURL, oAuth2Config.CustomURLMapping)
@@ -336,7 +336,7 @@ func UpdateSource(source *LoginSource) error {
if err != nil {
// restore original values since we cannot update the provider it self
- x.Id(source.ID).AllCols().Update(originalLoginSource)
+ x.ID(source.ID).AllCols().Update(originalLoginSource)
}
}
return err
@@ -362,7 +362,7 @@ func DeleteSource(source *LoginSource) error {
oauth2.RemoveProvider(source.Name)
}
- _, err = x.Id(source.ID).Delete(new(LoginSource))
+ _, err = x.ID(source.ID).Delete(new(LoginSource))
return err
}
@@ -647,7 +647,7 @@ func UserSignIn(username, password string) (*User, error) {
default:
var source LoginSource
- hasSource, err := x.Id(user.LoginSource).Get(&source)
+ hasSource, err := x.ID(user.LoginSource).Get(&source)
if err != nil {
return nil, err
} else if !hasSource {