From 0077b2661e7e5be7b2e3772113abeb401f4085d5 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 8 Jan 2024 17:53:02 +0100 Subject: [PATCH] [GITEA] add option for banning dots in usernames (squash) set in test (cherry picked from commit b005b586c354119d2b6aaf6e4c18eb3f1ddfb615) --- models/user/user_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/models/user/user_test.go b/models/user/user_test.go index 0e08529156..d89f99b871 100644 --- a/models/user/user_test.go +++ b/models/user/user_test.go @@ -556,6 +556,11 @@ func Test_ValidateUser(t *testing.T) { } func Test_NormalizeUserFromEmail(t *testing.T) { + oldSetting := setting.Service.AllowDotsInUsernames + defer func() { + setting.Service.AllowDotsInUsernames = oldSetting + }() + setting.Service.AllowDotsInUsernames = true testCases := []struct { Input string Expected string