diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -441,7 +441,10 @@ class Post(models.Model, Viewable): referenced_threads = referenced_post.get_threads().all() for thread in referenced_threads: + if thread.can_bump(): + thread.update_bump_status() + thread.last_edit_time = self.pub_time - thread.save(update_fields=['last_edit_time']) + thread.save(update_fields=['last_edit_time', 'bumpable']) self.threads.add(thread) diff --git a/boards/models/thread.py b/boards/models/thread.py --- a/boards/models/thread.py +++ b/boards/models/thread.py @@ -73,12 +73,15 @@ class Thread(models.Model): if self.can_bump(): self.bump_time = self.last_edit_time - if self.get_reply_count() >= settings.MAX_POSTS_PER_THREAD: - self.bumpable = False - self.update_posts_time() + self.update_bump_status() logger.info('Bumped thread %d' % self.id) + def update_bump_status(self): + if self.get_reply_count() >= settings.MAX_POSTS_PER_THREAD: + self.bumpable = False + self.update_posts_time() + def get_reply_count(self): return self.get_replies().count() @@ -189,3 +192,5 @@ class Thread(models.Model): def update_posts_time(self): self.post_set.update(last_edit_time=self.last_edit_time) + for post in self.post_set.all(): + post.threads.update(last_edit_time=self.last_edit_time)