Skip to content

Commit 5bf626c

Browse files
committed
fix
1 parent 32ad9ba commit 5bf626c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

models/user/user.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,8 @@ func createUser(ctx context.Context, u *User, meta *Meta, createdByAdmin bool, o
799799
}
800800

801801
if err := db.Insert(ctx, &NotificationSettings{
802-
UserID: u.ID,
802+
UserID: u.ID,
803+
Actions: NotificationGiteaActionsFailureOnly,
803804
}); err != nil {
804805
return err
805806
}

routers/web/user/setting/notifications.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"errors"
88
"net/http"
99

10+
"code.gitea.io/gitea/models/unit"
1011
user_model "code.gitea.io/gitea/models/user"
1112
"code.gitea.io/gitea/modules/log"
1213
"code.gitea.io/gitea/modules/optional"
@@ -70,7 +71,7 @@ func NotificationsEmailPost(ctx *context.Context) {
7071

7172
// NotificationsActionsEmailPost set user's email notification preference on Gitea Actions
7273
func NotificationsActionsEmailPost(ctx *context.Context) {
73-
if !ctx.GetContextValue("EnableActions").(bool) {
74+
if !setting.Actions.Enabled || unit.TypeActions.UnitGlobalDisabled() {
7475
ctx.NotFound(nil)
7576
return
7677
}

0 commit comments

Comments
 (0)