Skip to content
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

Fix/validation #834

Merged
merged 4 commits into from
Apr 9, 2024
Merged

Fix/validation #834

merged 4 commits into from
Apr 9, 2024

Conversation

hellais
Copy link
Member

@hellais hellais commented Apr 9, 2024

Pydantic has an unusual default behaviour when you set a default value for Field:

validate_default	bool | None	If True, apply validation to the default value every time you create an instance. Otherwise, for performance reasons, the default value of the field is trusted and not validated.	

https://docs.pydantic.dev/latest/api/fields/

This was leading to a validation bypass when the fields that specified an invalid default value were not being set.

We fix that bug, but also add extra validation that checks if the author matches the email address and refactoring of the authentication logic.

@hellais hellais requested a review from DecFox April 9, 2024 12:45
Copy link
Contributor

@DecFox DecFox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hellais hellais merged commit 57de625 into master Apr 9, 2024
5 checks passed
@hellais hellais deleted the fix/validation branch April 9, 2024 13:31
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.

2 participants