##// END OF EJS Templates
Fixed thread autoarchiving
neko259 -
r603:1075472a default
parent child Browse files
Show More
@@ -123,7 +123,7 b' class PostManager(models.Manager):'
123 archive the old ones.
123 archive the old ones.
124 """
124 """
125
125
126 threads = Thread.objects.filter(archived=False)
126 threads = Thread.objects.filter(archived=False).order_by('-bump_time')
127 thread_count = threads.count()
127 thread_count = threads.count()
128
128
129 if thread_count > settings.MAX_THREAD_COUNT:
129 if thread_count > settings.MAX_THREAD_COUNT:
@@ -56,9 +56,10 b' class Tag(models.Model):'
56 modifier = ARCHIVE_POPULARITY_MODIFIER
56 modifier = ARCHIVE_POPULARITY_MODIFIER
57 else:
57 else:
58 modifier = 1
58 modifier = 1
59 tag_reply_count += thread.get_reply_count() * modifier
59 tag_reply_count += thread.get_reply_count() * modifier \
60 / thread.tags.all().count()
60
61
61 popularity = tag_reply_count / all_post_count / thread.tags.all().count()
62 popularity = tag_reply_count / all_post_count
62
63
63 return popularity
64 return popularity
64
65
General Comments 0
You need to be logged in to leave comments. Login now