# HG changeset patch # User neko259 # Date 2016-11-28 15:04:42 # Node ID a6b599adc0ddc052f2c6976a5f6f5c52dcbd6ae5 # Parent 0b70a1510d10087995a804a032a1fbc3f2a9aa9c Fixed issues related to removal of multithread posts diff --git a/boards/models/post/__init__.py b/boards/models/post/__init__.py --- a/boards/models/post/__init__.py +++ b/boards/models/post/__init__.py @@ -152,13 +152,6 @@ class Post(models.Model, Viewable): def get_thread_id(self): return self.thread_id - def get_threads(self) -> QuerySet: - """ - Gets post's thread. - """ - - return self.threads - def _get_cache_key(self): return [datetime_to_epoch(self.last_edit_time)] diff --git a/boards/models/thread.py b/boards/models/thread.py --- a/boards/models/thread.py +++ b/boards/models/thread.py @@ -238,14 +238,12 @@ class Thread(models.Model): def update_posts_time(self, exclude_posts=None): last_edit_time = self.last_edit_time - for post in self.multi_replies.all(): + for post in self.replies.all(): if exclude_posts is None or post not in exclude_posts: # Manual update is required because uids are generated on save post.last_edit_time = last_edit_time post.save(update_fields=['last_edit_time']) - post.get_threads().update(last_edit_time=last_edit_time) - def notify_clients(self): if not settings.get_bool('External', 'WebsocketsEnabled'): return