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: """