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

Fixed #35223 -- Made Model.full_clean() ignore fields with db_default when validating empty values. #17939

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

bcail
Copy link
Contributor

@bcail bcail commented Mar 5, 2024

Trac ticket number

ticket-35223

Branch description

full_clean() should not raise a ValidationError for an empty field with a db_default.

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • For UI changes, I have attached screenshots in both light and dark modes.

@shangxiao
Copy link
Contributor

@bcail can you update the release notes for 5.1? 🙏

@bcail
Copy link
Contributor Author

bcail commented Mar 6, 2024

Thanks for the review, @shangxiao - I added a release note and removed the new test model.

@felixxm felixxm self-assigned this Mar 7, 2024
@felixxm felixxm changed the title Fixed #35223: handled db_default fields properly in full_clean. Fixed #35223 -- Made Model.full_clean() ignore fields with db_default when validating empty values. Mar 7, 2024
docs/releases/5.1.txt Outdated Show resolved Hide resolved
@felixxm felixxm force-pushed the issue-35223-db-default-full-clean branch from ea30419 to f9f8941 Compare March 7, 2024 12:34
@felixxm
Copy link
Member

felixxm commented Mar 7, 2024

@bcail Thanks 👍 I added release notes for 5.0.4.

@felixxm felixxm force-pushed the issue-35223-db-default-full-clean branch from f9f8941 to 7d710b3 Compare March 7, 2024 12:56
… when validating empty values.

Thanks Brian Ibbotson for the report.

Regression in 7414704.
@felixxm felixxm force-pushed the issue-35223-db-default-full-clean branch from 7d710b3 to 1570ef0 Compare March 8, 2024 04:55
@felixxm felixxm merged commit 1570ef0 into django:main Mar 8, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants