diff options
author | Ethan Koenig <ethantkoenig@gmail.com> | 2017-10-04 21:43:04 -0700 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-10-05 07:43:04 +0300 |
commit | aa962deec037375a7cfae3b96094becdfe48e778 (patch) | |
tree | b4322667ac85dd945c0a6aa65c96ba4fa9b96654 /models/user.go | |
parent | e1266a19c847600aceee6f16875e0384c7c0f736 (diff) | |
download | gitea-aa962deec037375a7cfae3b96094becdfe48e778.tar.gz gitea-aa962deec037375a7cfae3b96094becdfe48e778.zip |
Replace deprecated Id method with ID (#2655)
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/models/user.go b/models/user.go index 698d0207ec..f0cdc74d05 100644 --- a/models/user.go +++ b/models/user.go @@ -302,7 +302,7 @@ func (u *User) generateRandomAvatar(e Engine) error { } defer fw.Close() - if _, err := e.Id(u.ID).Cols("avatar").Update(u); err != nil { + if _, err := e.ID(u.ID).Cols("avatar").Update(u); err != nil { return err } @@ -459,7 +459,7 @@ func (u *User) DeleteAvatar() error { u.UseCustomAvatar = false u.Avatar = "" - if _, err := x.Id(u.ID).Cols("avatar, use_custom_avatar").Update(u); err != nil { + if _, err := x.ID(u.ID).Cols("avatar, use_custom_avatar").Update(u); err != nil { return fmt.Errorf("UpdateUser: %v", err) } return nil @@ -862,7 +862,7 @@ func updateUser(e Engine, u *User) error { u.Website = base.TruncateString(u.Website, 255) u.Description = base.TruncateString(u.Description, 255) - _, err := e.Id(u.ID).AllCols().Update(u) + _, err := e.ID(u.ID).AllCols().Update(u) return err } @@ -893,7 +893,7 @@ func updateUserCols(e Engine, u *User, cols ...string) error { u.Website = base.TruncateString(u.Website, 255) u.Description = base.TruncateString(u.Description, 255) - _, err := e.Id(u.ID).Cols(cols...).Update(u) + _, err := e.ID(u.ID).Cols(cols...).Update(u) return err } @@ -1019,7 +1019,7 @@ func deleteUser(e *xorm.Session, u *User) error { } // ***** END: ExternalLoginUser ***** - if _, err = e.Id(u.ID).Delete(new(User)); err != nil { + if _, err = e.ID(u.ID).Delete(new(User)); err != nil { return fmt.Errorf("Delete: %v", err) } @@ -1112,7 +1112,7 @@ func GetUserByKeyID(keyID int64) (*User, error) { func getUserByID(e Engine, id int64) (*User, error) { u := new(User) - has, err := e.Id(id).Get(u) + has, err := e.ID(id).Get(u) if err != nil { return nil, err } else if !has { |