Skip to content

bug: ignore grant removed from round in clr calculation #9876

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

Merged
merged 2 commits into from
Dec 14, 2021

Conversation

thelostone-mc
Copy link
Member

@thelostone-mc thelostone-mc commented Dec 13, 2021

Description

Currently if during a round if a grant is removed from a CLR round, the CLRCalculation is still taked into account as the latest field is marked True and hasn't been toggled back.

This PR ensures that when the clr cals are run the next time -> it toggle the latest flag to False for all grant's clr cals which are no longer part of the round.

Refers/Fixes

https://discord.com/channels/562828676480237578/907740735602851840/919793535702691890

@@ -485,7 +486,11 @@ def predict_clr(save_to_db=False, from_date=None, clr_round=None, network='mainn
print(f"- starting grants iter at {round(time.time(),1)}")
# for full calc - calculate the clr for each grant given additional potential_donations
total_count = grants.count()

invalid_clr_calculations = GrantCLRCalculation.objects.filter(latest=True, grantclr=clr_round.pk)
Copy link
Contributor

Choose a reason for hiding this comment

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

Really nice approach here!! 🚀

Co-authored-by: Graham Dixon <[email protected]>
@thelostone-mc thelostone-mc marked this pull request as ready for review December 14, 2021 05:11
@thelostone-mc thelostone-mc merged commit e864f2a into stable Dec 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.

2 participants