Skip to content

Commit cc907b0

Browse files
committed
Merge remote-tracking branch 'upstream/stable'
2 parents 5651a0a + e864f2a commit cc907b0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

app/dashboard/sync/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def record_payout_activity(fulfillment):
3737
created_by=kwargs['profile'])
3838
bounty.handle_event(event)
3939
activity = Activity.objects.create(**kwargs)
40-
activity.populate_hackathon_activity_index()
40+
activity.populate_activity_index()
4141

4242
except Exception as e:
4343
logger.error(f"error in record_bounty_activity: {e} - {event_name} - {bounty}")

app/grants/clr.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import numpy as np
2626
from grants.clr_data_src import fetch_contributions, fetch_grants, fetch_summed_contributions
27+
from grants.models import GrantCLRCalculation
2728

2829

2930
def populate_data_for_clr(grants, contributions, clr_round):
@@ -485,7 +486,11 @@ def predict_clr(save_to_db=False, from_date=None, clr_round=None, network='mainn
485486
print(f"- starting grants iter at {round(time.time(),1)}")
486487
# for full calc - calculate the clr for each grant given additional potential_donations
487488
total_count = grants.count()
489+
490+
invalid_clr_calculations = GrantCLRCalculation.objects.filter(latest=True, grantclr=clr_round.pk)
491+
488492
for grant in grants:
493+
invalid_clr_calculations.exclude(grant=grant.pk)
489494
# five potential additional donations plus the base case of 0
490495
potential_donations = [0, 1, 10, 100, 1000, 10000]
491496

@@ -545,6 +550,8 @@ def predict_clr(save_to_db=False, from_date=None, clr_round=None, network='mainn
545550

546551
debug_output.append({'grant': grant.id, "title": grant.title, "clr_prediction_curve": (potential_donations, potential_clr), "grants_clr": grants_clr})
547552

553+
invalid_clr_calculations.update(latest=False, active=False)
554+
548555
print(f"\nTotal execution time: {(timezone.now() - clr_calc_start_time)}\n")
549556

550557
return debug_output

0 commit comments

Comments
 (0)