Skip to content

Commit 741263b

Browse files
committed
workaround
1 parent 391d6ee commit 741263b

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

routers/web/user/setting/notifications.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,12 @@ func Notifications(ctx *context.Context) {
3030
ctx.Data["PageIsSettingsNotifications"] = true
3131
ctx.Data["EmailNotificationsPreference"] = ctx.Doer.EmailNotificationsPreference
3232

33-
fineGrainedPreference, err := user_model.GetSettings(ctx, ctx.Doer.ID, []string{
34-
user_model.SettingsEmailNotificationGiteaActions,
35-
})
33+
actionsEmailPref, err := user_model.GetUserSetting(ctx, ctx.Doer.ID, user_model.SettingsEmailNotificationGiteaActions, user_model.EmailNotificationGiteaActionsFailureOnly)
3634
if err != nil {
37-
ctx.ServerError("GetUserNotificationSettings", err)
35+
ctx.ServerError("GetUserSetting", err)
3836
return
3937
}
40-
actionsNotify := fineGrainedPreference[user_model.SettingsEmailNotificationGiteaActions].SettingValue
41-
if actionsNotify == "" {
42-
actionsNotify = user_model.EmailNotificationGiteaActionsFailureOnly
43-
}
44-
ctx.Data["ActionsEmailNotificationsPreference"] = actionsNotify
38+
ctx.Data["ActionsEmailNotificationsPreference"] = actionsEmailPref
4539

4640
ctx.HTML(http.StatusOK, tplSettingsNotifications)
4741
}

0 commit comments

Comments
 (0)