[MM-22037] Enable uppercase letters in the email (#13794)

* Enable uppercase letters in the email

* Lowercase email on every input

* Remove invalid test
Этот коммит содержится в:
Shota Gvinepadze
2020-02-12 17:51:45 +04:00
коммит произвёл GitHub
родитель 28ef877876
Коммит a7854f1b97
10 изменённых файлов: 25 добавлений и 14 удалений

Просмотреть файл

@@ -47,6 +47,7 @@ func userFromGitLabUser(glu *GitLabUser) *model.User {
user.FirstName = glu.Name
}
user.Email = glu.Email
user.Email = strings.ToLower(user.Email)
userId := glu.getAuthData()
user.AuthData = &userId
user.AuthService = model.USER_AUTH_SERVICE_GITLAB

Просмотреть файл

@@ -184,16 +184,6 @@ func TestIsValidEmail(t *testing.T) {
}
}
func TestValidLower(t *testing.T) {
if !IsLower("corey+test@hulen.com") {
t.Error("should be valid")
}
if IsLower("Corey+test@hulen.com") {
t.Error("should be invalid")
}
}
func TestEtag(t *testing.T) {
etag := Etag("hello", 24)
require.NotEqual(t, "", etag)