##// END OF EJS Templates
Get opening post only once when reversing post url
neko259 -
r591:12e7d699 default
parent child Browse files
Show More
@@ -318,10 +318,11 b' class Post(models.Model):'
318 link = cache.get(cache_key)
318 link = cache.get(cache_key)
319
319
320 if not link:
320 if not link:
321 if not self.is_opening():
321 opening_post = self.thread_new.get_opening_post()
322 link = reverse('thread', kwargs={
322 if self == opening_post:
323 'post_id': self.thread_new.get_opening_post().id}) + '#' + str(
323 link = reverse('thread',
324 self.id)
324 kwargs={'post_id': opening_post.id}) + '#' + str(
325 self.id)
325 else:
326 else:
326 link = reverse('thread', kwargs={'post_id': self.id})
327 link = reverse('thread', kwargs={'post_id': self.id})
327
328
General Comments 0
You need to be logged in to leave comments. Login now