We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a966611 + d616e93 commit e7fc536Copy full SHA for e7fc536
spp_pmt/models/pmt.py
@@ -76,7 +76,10 @@ def compute_score(self, field_name):
76
if hasattr(ind.individual, field):
77
total_score += getattr(ind.individual, field) * weight
78
total_weight += weight
79
- z_ind_grp_pmt_score = total_score / total_weight
+ if total_weight > 0:
80
+ z_ind_grp_pmt_score = total_score / total_weight
81
+ else:
82
+ z_ind_grp_pmt_score = 0
83
setattr(record, field_name, z_ind_grp_pmt_score)
84
else:
85
setattr(record, field_name, 0)
0 commit comments