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

Avoid double save in _set_flag_state #115

Merged
merged 1 commit into from
Jul 27, 2023
Merged

Conversation

adamchainz
Copy link
Contributor

FlagState.objects.create calls FlagState.save, but this isn't necessary as the line below calls it after setting the right value. Avoiding this extra save() will speed up creating flags through enable_flag / disable_flag.

@willbarton willbarton self-requested a review July 26, 2023 12:31
@willbarton
Copy link
Member

Thank you, @adamchainz!

@willbarton willbarton merged commit 9cfbb6c into cfpb:main Jul 27, 2023
9 checks passed
@adamchainz adamchainz deleted the patch-1 branch July 27, 2023 21:56
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