Skip to content

Conversation

@binaryDiv
Copy link
Contributor

@binaryDiv binaryDiv commented May 22, 2023

This PR adds the optional boolean parameter to_lowercase to the EmailValidator.

If set, the output email address is automatically converted to lowercase. (Default: False)

@binaryDiv binaryDiv added the enhancement Improvements to existing features or smaller new features label May 22, 2023
@binaryDiv binaryDiv self-assigned this May 22, 2023
@binaryDiv binaryDiv force-pushed the email-validator-auto-lowercase branch from 8e61ff9 to 9df1451 Compare May 22, 2023 16:33
@binaryDiv binaryDiv changed the base branch from dataclass-post-validate-without-varkwargs to main May 22, 2023 16:34
@binaryDiv binaryDiv force-pushed the email-validator-auto-lowercase branch 2 times, most recently from 8bbe102 to 7809d68 Compare May 22, 2023 16:36
@ninanomenon
Copy link

I'm not quite sure what these changes are for and I have a few questions about validataclass basically, but that's outside the scope of the PR.

So LGTM.

@binaryDiv
Copy link
Contributor Author

@L1F

I'm not quite sure what these changes are for

Concrete example: When setting the email address of a user, it's useful to normalize it to be all-lowercase in the database so that logging in with the email address works case-insensitively. (The database could also do that of course, but I think it's best to directly store the normalized versions.) But the validator should still accept email addresses with uppercase letters because users might input it that way.

@binaryDiv binaryDiv force-pushed the email-validator-auto-lowercase branch from 59152ae to 038c911 Compare May 24, 2023 09:31
@binaryDiv binaryDiv marked this pull request as ready for review May 24, 2023 09:32
@binaryDiv binaryDiv changed the title DRAFT: EmailValidator: Add parameter to convert to lowercase EmailValidator: Add parameter to convert to lowercase May 24, 2023
@binaryDiv binaryDiv merged commit 96d56ba into main May 24, 2023
@binaryDiv binaryDiv deleted the email-validator-auto-lowercase branch May 24, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvements to existing features or smaller new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants