Skip to content

Commit 43ded8e

Browse files
committed
[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 e7cb8da * Always enable caches (go-gitea#28527)
1 parent e21252f commit 43ded8e

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

routers/web/auth/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ func ActivatePost(ctx *context.Context) {
696696
}
697697
// Change the primary email
698698
if setting.Service.RegisterEmailConfirm {
699-
if setting.CacheService.Enabled && ctx.Cache.IsExist("MailResendLimit_"+ctx.Doer.LowerName) {
699+
if false && ctx.Cache.IsExist("MailResendLimit_"+ctx.Doer.LowerName) {
700700
ctx.Data["ResendLimited"] = true
701701
} else {
702702
ctx.Data["ActiveCodeLives"] = timeutil.MinutesToFriendly(setting.Service.ActiveCodeLives, ctx.Locale)

tests/integration/signup_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ func TestSignupEmailChangeForInactiveUser(t *testing.T) {
9999
// Disable the captcha & enable email confirmation for registrations
100100
defer test.MockVariableValue(&setting.Service.EnableCaptcha, false)()
101101
defer test.MockVariableValue(&setting.Service.RegisterEmailConfirm, true)()
102-
defer test.MockVariableValue(&setting.CacheService.Enabled, false)()
103102

104103
// Create user
105104
req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{
@@ -133,7 +132,6 @@ func TestSignupEmailChangeForActiveUser(t *testing.T) {
133132
// Disable the captcha & enable email confirmation for registrations
134133
defer test.MockVariableValue(&setting.Service.EnableCaptcha, false)()
135134
defer test.MockVariableValue(&setting.Service.RegisterEmailConfirm, false)()
136-
defer test.MockVariableValue(&setting.CacheService.Enabled, false)()
137135

138136
// Create user
139137
req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{

0 commit comments

Comments
 (0)