# HG changeset patch # User neko259 # Date 2014-01-28 14:32:37 # Node ID 1075472a3426c21c4fa616457bf9cfe1e03adc7f # Parent 04582070daab0797ea32cd48b8205a8d68dc98fc Fixed thread autoarchiving diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -123,7 +123,7 @@ class PostManager(models.Manager): archive the old ones. """ - threads = Thread.objects.filter(archived=False) + threads = Thread.objects.filter(archived=False).order_by('-bump_time') thread_count = threads.count() if thread_count > settings.MAX_THREAD_COUNT: diff --git a/boards/models/tag.py b/boards/models/tag.py --- a/boards/models/tag.py +++ b/boards/models/tag.py @@ -56,9 +56,10 @@ class Tag(models.Model): modifier = ARCHIVE_POPULARITY_MODIFIER else: modifier = 1 - tag_reply_count += thread.get_reply_count() * modifier + tag_reply_count += thread.get_reply_count() * modifier \ + / thread.tags.all().count() - popularity = tag_reply_count / all_post_count / thread.tags.all().count() + popularity = tag_reply_count / all_post_count return popularity