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 blank fields trying to insert NULL #110

Merged
merged 3 commits into from
Apr 11, 2024

Conversation

julianwachholz
Copy link
Contributor

A fix that prevents IntegrityErrors when trying to save a translated field with blank=True and null=False.
Previously it would always try to insert NULL into the database.

Django strongly recommends using empty strings instead of NULL for textual fields.

Copy link
Member

@jieter jieter left a comment

Choose a reason for hiding this comment

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

This should be covered by a unit test, can you add one?

@julianwachholz
Copy link
Contributor Author

I reflected the new behavior in the existing tests, is this ok? I also replaced the suggested optional fields in the documentation with blank=True.

Copy link
Member

@jieter jieter left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@jieter jieter merged commit 8623ee1 into zostera:master Apr 11, 2024
16 checks passed
@julianwachholz julianwachholz deleted the fix-blank-fields branch April 17, 2024 06:33
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