diff --git a/controllers/account.go b/controllers/account.go index e952dad5..29dcb882 100644 --- a/controllers/account.go +++ b/controllers/account.go @@ -149,8 +149,6 @@ func (c *ApiController) Signup() { username = id } - userCount := object.GetUserCount(form.Organization, "", "") + 1 - user := &object.User{ Owner: form.Organization, Name: username, @@ -173,7 +171,6 @@ func (c *ApiController) Signup() { IsDeleted: false, SignupApplication: application.Name, Properties: map[string]string{}, - Ranking: userCount + 1, Karma: 0, } diff --git a/object/user.go b/object/user.go index a488950b..2f9e7e97 100644 --- a/object/user.go +++ b/object/user.go @@ -352,6 +352,8 @@ func AddUser(user *User) bool { user.PermanentAvatar = getPermanentAvatarUrl(user.Owner, user.Name, user.Avatar) + user.Ranking = GetUserCount(user.Owner, "", "") + 1 + affected, err := adapter.Engine.Insert(user) if err != nil { panic(err)