mirror of
https://github.com/go-gitea/gitea
synced 2025-07-12 13:37:20 +00:00
Backport #11925 Use ID or Where to instead directly use Get when load object from database Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@ -111,8 +111,8 @@ func GetUserByOpenID(uri string) (*User, error) {
|
||||
log.Trace("Normalized OpenID URI: " + uri)
|
||||
|
||||
// Otherwise, check in openid table
|
||||
oid := &UserOpenID{URI: uri}
|
||||
has, err := x.Get(oid)
|
||||
oid := &UserOpenID{}
|
||||
has, err := x.Where("uri=?", uri).Get(oid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user