Skip to content

Commit

Permalink
fix: fix the No.0 bug(for all sign up methods) (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotoxin committed Mar 4, 2022
1 parent 178cf79 commit 4d48517
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions controllers/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ func (c *ApiController) Signup() {
username = id
}

userCount := object.GetUserCount(form.Organization, "", "") + 1

user := &object.User{
Owner: form.Organization,
Name: username,
Expand All @@ -173,7 +171,6 @@ func (c *ApiController) Signup() {
IsDeleted: false,
SignupApplication: application.Name,
Properties: map[string]string{},
Ranking: userCount + 1,
Karma: 0,
}

Expand Down
2 changes: 2 additions & 0 deletions object/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4d48517

Please sign in to comment.