Commit 75fb3fe6 authored by luxcem's avatar luxcem

fix score for up / down

parent 5db4c8b1
......@@ -68,7 +68,9 @@ class UnDVotedMixin(models.Model):
self.und_score_up += diff_score
# Update self score, use update and filter to avoid triggering signals
self.__class__.objects.filter(id=self.id).update(
und_score=F("und_score") + diff_score)
und_score=F("und_score") + diff_score,
und_score_up=F("und_score_up") + diff_score
)
def downvote(self, username):
diff_score = 0
......@@ -93,7 +95,9 @@ class UnDVotedMixin(models.Model):
self.und_score_down += diff_score
# Update self score, use update and filter to avoid triggering signals
self.__class__.objects.filter(id=self.id).update(
und_score=F("und_score") + diff_score)
und_score=F("und_score") + diff_score,
und_score_down=F("und_score_down") + diff_score
)
def update_und_score(self):
"""Reset score to the correct count (should not be necessary)"""
......
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