# HG changeset patch # User neko259 # Date 2015-05-19 13:04:17 # Node ID d378bd6dbead146e4912bf2c4513aee0fa3bb000 # Parent e46298a6a533fbf8ccf7735049a6bd28b5c43092 Don't show replies from other threads in the tree mode 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 @@ -193,7 +193,9 @@ class Post(models.Model, Viewable): return 'P#{}/{}'.format(self.id, self.title) def get_referenced_posts(self): - return self.referenced_posts.order_by('pub_time') + threads = self.get_threads().all() + return self.referenced_posts.filter(threads__in=threads)\ + .order_by('pub_time').distinct().all() def get_title(self) -> str: """