comparison gpp/forums/unread.py @ 148:35a0e6345815

Fix bug in the forums unread logic.
author Brian Neal <bgneal@gmail.com>
date Sun, 13 Dec 2009 21:57:34 +0000
parents 535d02d1c017
children cf9f9d4c4d54
comparison
equal deleted inserted replaced
147:152d77265da6 148:35a0e6345815
70 flv.begin_date = min_date 70 flv.begin_date = min_date
71 flv.save() 71 flv.save()
72 TopicLastVisit.objects.filter(user=user, topic__forum=forum, 72 TopicLastVisit.objects.filter(user=user, topic__forum=forum,
73 last_visit__lt=min_date).delete() 73 last_visit__lt=min_date).delete()
74 74
75 topics = Topic.objects.filter(creation_date__gt=flv.begin_date) 75 topics = Topic.objects.filter(forum=forum,
76 creation_date__gt=flv.begin_date)
76 tracked_topics = TopicLastVisit.objects.filter(user=user, 77 tracked_topics = TopicLastVisit.objects.filter(user=user,
77 topic__forum=forum, last_visit__gt=flv.begin_date) 78 topic__forum=forum, last_visit__gt=flv.begin_date)
78 79
79 # If the number of topics created since our window was started 80 # If the number of topics created since our window was started
80 # is greater than the tracked topic records, then there are new 81 # is greater than the tracked topic records, then there are new