Avoid linking the same account twice.

This commit is contained in:
Yang Luo
2021-06-18 23:25:24 +08:00
parent 01d5f3b776
commit 6dc3fd0f45
2 changed files with 15 additions and 0 deletions

View File

@ -24,6 +24,10 @@ import (
)
func GetUserByField(organizationName string, field string, value string) *User {
if field == "" || value == "" {
return nil
}
user := User{Owner: organizationName}
existed, err := adapter.Engine.Where(fmt.Sprintf("%s=?", field), value).Get(&user)
if err != nil {