From 1497412133c365892ab39c2c2071c45d06e9ed43 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 5 May 2016 19:37:02 +0800 Subject: [PATCH] Attempting to correct sub counts for branched feeds. --- apps/rss_feeds/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/rss_feeds/models.py b/apps/rss_feeds/models.py index b202117b4..ce8835d64 100644 --- a/apps/rss_feeds/models.py +++ b/apps/rss_feeds/models.py @@ -692,7 +692,7 @@ class Feed(models.Model): def count_subscribers(self, recount=True, verbose=False): if recount or not self.counts_converted_to_redis: from apps.profile.models import Profile - Profile.count_feed_subscribers(feed_id=self.pk) + Profile.count_feed_subscribers(feed_id=self.original_feed_id) SUBSCRIBER_EXPIRE_DATE = datetime.datetime.now() - datetime.timedelta(days=settings.SUBSCRIBER_EXPIRE) subscriber_expire = int(SUBSCRIBER_EXPIRE_DATE.strftime('%s')) now = int(datetime.datetime.now().strftime('%s')) @@ -723,10 +723,10 @@ class Feed(models.Model): results = pipeline.execute() # -1 due to key=-1 signaling counts_converted_to_redis - total += results[0] - 1 - active += results[1] - 1 - premium += results[2] - 1 - active_premium += results[3] - 1 + total += results[0] + active += results[1] + premium += results[2] + active_premium += results[3] original_num_subscribers = self.num_subscribers original_active_subs = self.active_subscribers