mirror of
https://github.com/gogs/gogs.git
synced 2025-12-20 15:20:01 +01:00
Fix create user can use user email which is used (#4016)
This commit is contained in:
2
gogs.go
2
gogs.go
@@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.9.125.0128"
|
const APP_VER = "0.9.126.0129"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
setting.AppVer = APP_VER
|
setting.AppVer = APP_VER
|
||||||
|
|||||||
@@ -58,7 +58,15 @@ func isEmailUsed(e Engine, email string) (bool, error) {
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return e.Get(&EmailAddress{Email: email})
|
has, err := e.Get(&EmailAddress{Email: email})
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
} else if has {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// We need to check primary email of users as well.
|
||||||
|
return e.Where("type=?", USER_TYPE_INDIVIDUAL).And("email=?", email).Get(new(User))
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsEmailUsed returns true if the email has been used.
|
// IsEmailUsed returns true if the email has been used.
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
0.9.125.0128
|
0.9.126.0129
|
||||||
Reference in New Issue
Block a user