mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +08:00
fix: fix the No.0 bug(for all sign up methods) (#535)
This commit is contained in:
parent
178cf7945d
commit
4d48517be9
@ -149,8 +149,6 @@ func (c *ApiController) Signup() {
|
|||||||
username = id
|
username = id
|
||||||
}
|
}
|
||||||
|
|
||||||
userCount := object.GetUserCount(form.Organization, "", "") + 1
|
|
||||||
|
|
||||||
user := &object.User{
|
user := &object.User{
|
||||||
Owner: form.Organization,
|
Owner: form.Organization,
|
||||||
Name: username,
|
Name: username,
|
||||||
@ -173,7 +171,6 @@ func (c *ApiController) Signup() {
|
|||||||
IsDeleted: false,
|
IsDeleted: false,
|
||||||
SignupApplication: application.Name,
|
SignupApplication: application.Name,
|
||||||
Properties: map[string]string{},
|
Properties: map[string]string{},
|
||||||
Ranking: userCount + 1,
|
|
||||||
Karma: 0,
|
Karma: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,6 +352,8 @@ func AddUser(user *User) bool {
|
|||||||
|
|
||||||
user.PermanentAvatar = getPermanentAvatarUrl(user.Owner, user.Name, user.Avatar)
|
user.PermanentAvatar = getPermanentAvatarUrl(user.Owner, user.Name, user.Avatar)
|
||||||
|
|
||||||
|
user.Ranking = GetUserCount(user.Owner, "", "") + 1
|
||||||
|
|
||||||
affected, err := adapter.Engine.Insert(user)
|
affected, err := adapter.Engine.Insert(user)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user