mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-22 09:54:24 +01:00
[GITEA] Allow changing the email address before activation (squash) cache is always active
This needs to be revisited because the MailResendLimit is not enforced
and turns out to not be tested.
See e7cb8da2a8
* Always enable caches (#28527)
This commit is contained in:
parent
e21252f147
commit
43ded8ee30
|
@ -696,7 +696,7 @@ func ActivatePost(ctx *context.Context) {
|
|||
}
|
||||
// Change the primary email
|
||||
if setting.Service.RegisterEmailConfirm {
|
||||
if setting.CacheService.Enabled && ctx.Cache.IsExist("MailResendLimit_"+ctx.Doer.LowerName) {
|
||||
if false && ctx.Cache.IsExist("MailResendLimit_"+ctx.Doer.LowerName) {
|
||||
ctx.Data["ResendLimited"] = true
|
||||
} else {
|
||||
ctx.Data["ActiveCodeLives"] = timeutil.MinutesToFriendly(setting.Service.ActiveCodeLives, ctx.Locale)
|
||||
|
|
|
@ -99,7 +99,6 @@ func TestSignupEmailChangeForInactiveUser(t *testing.T) {
|
|||
// Disable the captcha & enable email confirmation for registrations
|
||||
defer test.MockVariableValue(&setting.Service.EnableCaptcha, false)()
|
||||
defer test.MockVariableValue(&setting.Service.RegisterEmailConfirm, true)()
|
||||
defer test.MockVariableValue(&setting.CacheService.Enabled, false)()
|
||||
|
||||
// Create user
|
||||
req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{
|
||||
|
@ -133,7 +132,6 @@ func TestSignupEmailChangeForActiveUser(t *testing.T) {
|
|||
// Disable the captcha & enable email confirmation for registrations
|
||||
defer test.MockVariableValue(&setting.Service.EnableCaptcha, false)()
|
||||
defer test.MockVariableValue(&setting.Service.RegisterEmailConfirm, false)()
|
||||
defer test.MockVariableValue(&setting.CacheService.Enabled, false)()
|
||||
|
||||
// Create user
|
||||
req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{
|
||||
|
|
Loading…
Reference in a new issue