Commit ffe144e0 authored by Jamesie Pic's avatar Jamesie Pic

Oh, just fixed score update ^^

parent 8ff84b92
...@@ -63,18 +63,19 @@ class MemopolVote(Vote): ...@@ -63,18 +63,19 @@ class MemopolVote(Vote):
@cached_property @cached_property
def absolute_score(self): def absolute_score(self):
if self.proposal.recommendation: if not self.proposal.recommendation_id:
recommendation = self.proposal.recommendation return 0
weight = recommendation.weight
if (self.position == 'abstain' or recommendation = self.proposal.recommendation
weight = recommendation.weight
if (self.position == 'abstain' or
recommendation.recommendation == 'abstain'): recommendation.recommendation == 'abstain'):
weight = weight / 2 weight = weight / 2
if self.position == recommendation.recommendation: if self.position == recommendation.recommendation:
return weight return weight
else:
return -weight
else: else:
return 0 return -weight
def vote_pre_import(sender, vote_data=None, **kwargs): def vote_pre_import(sender, vote_data=None, **kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment