diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -298,7 +298,7 @@ class Post(models.Model): thread.last_edit_time = edit_time thread.save() - def get_url(self): + def get_url(self, thread=None): """ Gets full url to the post. """ @@ -307,7 +307,10 @@ class Post(models.Model): link = cache.get(cache_key) if not link: - opening_id = self.get_thread().get_opening_post_id() + if not thread: + thread = self.get_thread() + + opening_id = thread.get_opening_post_id() if self.id != opening_id: link = reverse('thread', kwargs={ diff --git a/boards/templates/boards/post.html b/boards/templates/boards/post.html --- a/boards/templates/boards/post.html +++ b/boards/templates/boards/post.html @@ -31,7 +31,7 @@