From d8d594840ad17ac4081aee2da1c339be435247ba Mon Sep 17 00:00:00 2001 From: Raajheer1 Date: Sat, 5 Oct 2024 18:16:34 -0500 Subject: [PATCH] Here too --- external/v3/user/login.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/external/v3/user/login.go b/external/v3/user/login.go index 3a6550e..99fdc5d 100644 --- a/external/v3/user/login.go +++ b/external/v3/user/login.go @@ -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