Attempting to fix oldest cutoff mark feed read date bug.

This commit is contained in:
Samuel Clay 2016-03-14 11:51:18 -07:00
parent 611b857acc
commit 8ea2c6ef55
2 changed files with 10 additions and 5 deletions

View file

@ -602,9 +602,14 @@ class UserSubscription(models.Model):
cutoff_date = datetime.datetime.utcnow()
recount = False
self.last_read_date = cutoff_date
self.mark_read_date = cutoff_date
self.oldest_unread_story_date = cutoff_date
if cutoff_date > self.mark_read_date or cutoff_date > self.oldest_unread_story_date:
self.last_read_date = cutoff_date
self.mark_read_date = cutoff_date
self.oldest_unread_story_date = cutoff_date
else:
logging.user(self.user, "Not marking %s as read: %s > %s/%s" %
(self, cutoff_date, self.mark_read_date, self.oldest_unread_story_date))
if not recount:
self.unread_count_negative = 0
self.unread_count_positive = 0

View file

@ -1717,8 +1717,8 @@ def mark_feed_as_read(request):
cutoff_date = datetime.datetime.fromtimestamp(cutoff_timestamp) if cutoff_timestamp else None
if cutoff_date:
logging.user(request, "~FMMark %s feeds read, cutoff: %s/%s" %
(len(feed_ids), cutoff_timestamp, cutoff_date))
logging.user(request, "~FMMark %s feeds read, %s - cutoff: %s/%s" %
(len(feed_ids), direction, cutoff_timestamp, cutoff_date))
for feed_id in feed_ids:
if 'social:' in feed_id: