Changing how unreads are calculated. If all stories are red, that's OK for now. Prevents the weird situation when training a feed and everything switches colors at once (same author or something), and when the unreads cycle through red, then everything gets marked as read. Not the desired behavior. And who is this helping, anyhow?

This commit is contained in:
Samuel Clay 2011-03-17 22:15:29 -04:00
parent 0f9474c896
commit 691898e922
2 changed files with 5 additions and 7 deletions

View file

@ -17,7 +17,7 @@ def index(requst):
@json.json_view
def save_classifier(request):
post = request.POST
logging.user(request.user, "~FGSaving classifier: ~FW%s" % (post))
logging.user(request.user, "~FGSaving classifier: ~SB%s~SN ~FW%s" % (feed, post))
feed_id = int(post['feed_id'])
feed = get_object_or_404(Feed, pk=feed_id)
code = 0
@ -73,8 +73,6 @@ def save_classifier(request):
_save_classifier(MClassifierTag, 'tag')
_save_classifier(MClassifierTitle, 'title')
_save_classifier(MClassifierFeed, 'feed')
logging.user(request.user, "~FGFeed training: ~SB%s" % (feed))
response = dict(code=code, message=message, payload=payload)
return response

View file

@ -238,10 +238,10 @@ class UserSubscription(models.Model):
self.needs_unread_recalc = False
self.save()
if (self.unread_count_positive == 0 and
self.unread_count_neutral == 0):
self.mark_feed_read()
# if (self.unread_count_positive == 0 and
# self.unread_count_neutral == 0):
# self.mark_feed_read()
cache.delete('usersub:%s' % self.user.id)