Skip to content
Extraits de code Groupes Projets
Valider ffe144e0 rédigé par Jamesie Pic's avatar Jamesie Pic
Parcourir les fichiers

Oh, just fixed score update ^^

parent 8ff84b92
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -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):
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter