Skip to content

Commit

Permalink
Here too
Browse files Browse the repository at this point in the history
  • Loading branch information
Raajheer1 committed Oct 5, 2024
1 parent 06aa9dd commit d8d5948
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions external/v3/user/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,21 @@ func GetLoginCallback(w http.ResponseWriter, r *http.Request) {
utils.Render(w, r, utils.ErrInternalServerWithErr(err))
return
}

// Create user notification settings if they don't exist (due to old data migration)
dbUserNotificationSettings := &models.UserNotification{
CID: dbUser.CID,
DiscordEnabled: true,
EmailEnabled: true,
Training: true,
Events: true,
Feedback: true,
}

if err := dbUserNotificationSettings.Create(); err != nil {
utils.Render(w, r, utils.ErrInternalServerWithErr(err))
return
}
} else {
dbUser.FirstName = user.Personal.FirstName
dbUser.LastName = user.Personal.LastName
Expand Down

0 comments on commit d8d5948

Please sign in to comment.