From 7c6970fc3d6d6a9c22962f7b6aea56a3ce8bb60c Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Mon, 1 Oct 2012 10:48:06 -0600 Subject: [PATCH] Removed default values of one from ProposalResult denormalized fields The original default value of one assumed ProposalResult was being created when a Review was created which meant a comment and a vote was made. This is no longer the case from changes after the original change and has caused off by one errors in the denormalized count. --- symposion/reviews/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symposion/reviews/models.py b/symposion/reviews/models.py index 6c903f57..1cc5042e 100644 --- a/symposion/reviews/models.py +++ b/symposion/reviews/models.py @@ -198,8 +198,8 @@ class LatestVote(models.Model): class ProposalResult(models.Model): proposal = models.OneToOneField("proposals.ProposalBase", related_name="result") score = models.DecimalField(max_digits=5, decimal_places=2, default=Decimal("0.00")) - comment_count = models.PositiveIntegerField(default=1) - vote_count = models.PositiveIntegerField(default=1) + comment_count = models.PositiveIntegerField(default=0) + vote_count = models.PositiveIntegerField(default=0) plus_one = models.PositiveIntegerField(default=0) plus_zero = models.PositiveIntegerField(default=0) minus_zero = models.PositiveIntegerField(default=0)