From eba73cb5ba90480735958c2b2062f958b0639440 Mon Sep 17 00:00:00 2001 From: DEKHTIARJonathan Date: Mon, 14 Aug 2017 22:02:32 +0200 Subject: [PATCH] Fix in publication which was given "new subscriber" when a user didn't publish at all during the previous month. --- feedcrunch_rssadmin/views.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/feedcrunch_rssadmin/views.py b/feedcrunch_rssadmin/views.py index 4a7e90b..54332a3 100644 --- a/feedcrunch_rssadmin/views.py +++ b/feedcrunch_rssadmin/views.py @@ -56,9 +56,15 @@ def index(request, feedname=None): publication_trend = int(round(abs(publication_trend),0)) except ZeroDivisionError: - publication_trend = -1 - post_trending = "new_releases" - post_trending_color = "blue-grey-text" + timedelta_registred = timezone.now() - request.user.date_joined + if (timedelta_registred.days < 31): + publication_trend = -1 + post_trending = "new_releases" + post_trending_color = "blue-grey-text" + else: + publication_trend = 0 + post_trending = "trending_flat" + post_trending_color = "blue-grey-text" data = { 'monthtime_elapsed': monthtime_elapsed,