Skip to content

Commit

Permalink
Add this too
Browse files Browse the repository at this point in the history
  • Loading branch information
Raajheer1 committed Oct 5, 2024
1 parent f03bffe commit b526586
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions external/v3/user/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,23 @@ func GetLoginCallback(w http.ResponseWriter, r *http.Request) {
return
}
}

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

if err := dbUserNotificationSettings.Get(); err != nil {
dbUserNotificationSettings.DiscordEnabled = true
dbUserNotificationSettings.EmailEnabled = true
dbUserNotificationSettings.Training = true
dbUserNotificationSettings.Events = true
dbUserNotificationSettings.Feedback = true
if err := dbUserNotificationSettings.Create(); err != nil {
utils.Render(w, r, utils.ErrInternalServerWithErr(err))
return
}
}
}

redirect := session["redirect"]
Expand Down

0 comments on commit b526586

Please sign in to comment.