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: auto now fields should be skipped #507

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

mattwang44
Copy link
Contributor

Describe the change

  • Issue: When baker.make with _fill_optional set as True, the values of those DateTimeField with auto_now_add=True or auto_now=True from the resulting instance are different from the value stored in DB.
    • The test case from the first commit is to reproduce the issue image
  • solution: skip the auto datetime fields

PR Checklist

  • Change is covered with tests
  • CHANGELOG.md is updated if needed

@mattwang44
Copy link
Contributor Author

mattwang44 commented Oct 10, 2024

could possibly resolve #469

Copy link
Collaborator

@amureki amureki left a comment

Choose a reason for hiding this comment

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

@mattwang44 thank you for your first contribution! I am happy that you managed to figure out the issue and find your way through the code. 👍

@amureki amureki merged commit c0af32a into model-bakers:main Feb 11, 2025
@mattwang44 mattwang44 deleted the fix/auto-now-with-fill-optional branch February 12, 2025 02:29
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