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: ContentMetadata.bulk_update() changes the modified value #890

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

iloveagent57
Copy link
Contributor

@iloveagent57 iloveagent57 commented Jul 24, 2024

Prior to this change, the ContentMetadata.modified field was mostly meaningless, because TimeStampedModel only sets modified during calls to save(), but we mostly to updates of CM records via ContentMetadata.objects.bulk_update().

Post-review

  • Squash commits into discrete sets of changes
  • Ensure that once the changes have been deployed to stage, prod is manually deployed

Copy link
Contributor

@pwnage101 pwnage101 left a comment

Choose a reason for hiding this comment

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

non-blocking question: Before this PR the modified field was completely meaningless, but now it's eagerly updated for a record even if none of the other requested bulk fields have changed for that particular record; is there a way to efficiently set modified only if the record has changed?

@iloveagent57
Copy link
Contributor Author

Presumably the caller would not be calling bulk_update on a record(s) unless the record(s) have changed.

@iloveagent57 iloveagent57 merged commit 5f53a30 into master Jul 25, 2024
5 of 6 checks passed
@iloveagent57 iloveagent57 deleted the aed/bulk-update branch July 25, 2024 15:20
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