Skip to content

Fix Long Emails Breaking User Create Endpoint #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stefanotroncaro
Copy link
Contributor

@stefanotroncaro stefanotroncaro commented Apr 4, 2025

Resolves #19

The length constraint of the User.email field was exported to a constant so it can be used when declaring pydantic schemas.
This ensures that long emails won't pass over pydantic validation and reach the db, avoiding server errors.

Try with an email like: abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd@abcdefghijabcdefghijabcdefghijabcdefghij.com

I stored the constants in app/users/constants/ which perhaps it's not the best place. Suggestions welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creating accounts with very long emails results in a 500 server error
1 participant