Fix bug in updateUserForOriginalFields().

This commit is contained in:
Yang Luo
2021-12-25 00:19:17 +08:00
parent 4b4c9be71b
commit b60856be5e
2 changed files with 20 additions and 2 deletions

View File

@ -181,6 +181,24 @@ func getUser(owner string, name string) *User {
}
}
func getUserById(owner string, id string) *User {
if owner == "" || id == "" {
return nil
}
user := User{Owner: owner, Id: id}
existed, err := adapter.Engine.Get(&user)
if err != nil {
panic(err)
}
if existed {
return &user
} else {
return nil
}
}
func GetUserByEmail(owner string, email string) *User {
if owner == "" || email == "" {
return nil