diff --git a/backend/downtownapi/main/clr.py b/backend/downtownapi/main/clr.py index 3a22509..31d9992 100644 --- a/backend/downtownapi/main/clr.py +++ b/backend/downtownapi/main/clr.py @@ -100,11 +100,13 @@ def calculate_clr(aggregated_contributions, _cap=8000, total_pot=25000.0): # 1. normalize if bigtot >= total_pot: - t['clr_amount'] = ((clr_amount / bigtot) * total_pot) + clr_amount = ((clr_amount / bigtot) * total_pot) # 2. cap clr amount if clr_amount >= _cap: - t['clr_amount'] = _cap + clr_amount = _cap + + t['clr_amount'] = clr_amount # 3. calculate the total clr to be distributed bigtot_normalized_cap += t['clr_amount'] @@ -150,11 +152,13 @@ def calculate_live_clr(aggregated_contributions, business_id, _cap=8000, total_p # 1. normalize if bigtot >= total_pot: - t['clr_amount'] = ((clr_amount / bigtot) * total_pot) + clr_amount = ((clr_amount / bigtot) * total_pot) - # 2. cap clr amount + # 2. cap clr amount if clr_amount >= _cap: - t['clr_amount'] = _cap + clr_amount = _cap + + t['clr_amount'] = clr_amount # 3. calculate the total clr to be distributed bigtot_normalized_cap += t['clr_amount']