# HG changeset patch # User neko259 # Date 2013-09-23 12:31:01 # Node ID 4cfe57e4c5c3510906ff4a6b35e689bad8e44e87 # Parent 0afbf21f3abb97d8ec70d48661926dbeeb2c3a83 Optimized deleting old threads. diff --git a/boards/models.py b/boards/models.py --- a/boards/models.py +++ b/boards/models.py @@ -139,7 +139,7 @@ class PostManager(models.Manager): # must not be shown and be able for replying. threads = self.get_threads() - thread_count = len(threads) + thread_count = threads.count() if thread_count > settings.MAX_THREAD_COUNT: num_threads_to_delete = thread_count - settings.MAX_THREAD_COUNT