Skip to content

Commit

Permalink
fix: fix init data not saved to database (#2885) (#2886)
Browse files Browse the repository at this point in the history
  • Loading branch information
MyColorfulDays committed Apr 21, 2024
1 parent 87e2b97 commit d51af33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion object/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func getBuiltInAccountItems() []*AccountItem {
{Name: "Permissions", Visible: true, ViewRule: "Public", ModifyRule: "Immutable"},
{Name: "Groups", Visible: true, ViewRule: "Public", ModifyRule: "Admin"},
{Name: "3rd-party logins", Visible: true, ViewRule: "Self", ModifyRule: "Self"},
{Name: "Properties", Visible: false, ViewRule: "Admin", ModifyRule: "Admin"},
{Name: "Properties", Visible: true, ViewRule: "Admin", ModifyRule: "Admin"},
{Name: "Is admin", Visible: true, ViewRule: "Admin", ModifyRule: "Admin"},
{Name: "Is forbidden", Visible: true, ViewRule: "Admin", ModifyRule: "Admin"},
{Name: "Is deleted", Visible: true, ViewRule: "Admin", ModifyRule: "Admin"},
Expand Down
4 changes: 3 additions & 1 deletion object/init_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ func initDefinedUser(user *User) {
}
user.CreatedTime = util.GetCurrentTime()
user.Id = util.GenerateId()
user.Properties = make(map[string]string)
if user.Properties == nil {
user.Properties = make(map[string]string)
}
_, err = AddUser(user)
if err != nil {
panic(err)
Expand Down

0 comments on commit d51af33

Please sign in to comment.