diff options
Diffstat (limited to 'routers/user/setting/account.go')
-rw-r--r-- | routers/user/setting/account.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/user/setting/account.go b/routers/user/setting/account.go index ca9b5b3c32..3b4191f0be 100644 --- a/routers/user/setting/account.go +++ b/routers/user/setting/account.go @@ -7,6 +7,7 @@ package setting import ( "errors" + "time" "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/auth" @@ -300,4 +301,9 @@ func loadAccountData(ctx *context.Context) { ctx.Data["EmailNotificationsPreference"] = ctx.User.EmailNotifications() ctx.Data["ActivationsPending"] = pendingActivation ctx.Data["CanAddEmails"] = !pendingActivation || !setting.Service.RegisterEmailConfirm + + if setting.Service.UserDeleteWithCommentsMaxDays != 0 { + ctx.Data["UserDeleteWithCommentsMaxDays"] = setting.Service.UserDeleteWithCommentsMaxDays + ctx.Data["UserDeleteWithComments"] = ctx.User.CreatedUnix.AsTime().Add(time.Duration(setting.Service.UserDeleteWithCommentsMaxDays) * 24 * time.Hour).After(time.Now()) + } } |