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

Don't call a lifecycle hook twice with the same state. #8

Merged
merged 2 commits into from
Feb 14, 2021

Conversation

garyd203
Copy link
Contributor

This allows users to listen for multiple specific change events and handle them all in a single function.

I tried to follow the existing style for testing. Let me know if you would prefer a different approach, squashed migrations, etc.

This allows users to listen for multiple specific change events and
handle them all in a single function.
@garyd203
Copy link
Contributor Author

garyd203 commented Feb 3, 2020

Thanks @Faisal-Manzer , I have rebased my PR and updated the changes to suit the current codebase. Tests pass on my local machine.

Cheers,
gary

@Maushundb
Copy link

Maushundb commented Dec 9, 2020

+1 on merging this - looks like when_any fires the hook once per field changed, even if .save() was only called once on the model. @rsinger86

@rsinger86 rsinger86 merged commit b210d08 into rsinger86:master Feb 14, 2021
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.

4 participants