##// END OF EJS Templates
Optimized thread view
neko259 -
r648:d71b0365 default
parent child Browse files
Show More
@@ -180,6 +180,10 b' class PostForm(NeboardForm):'
180 180 def _validate_posting_speed(self):
181 181 can_post = True
182 182
183 # TODO Remove this, it's only for test
184 if not 'user_id' in self.session:
185 return
186
183 187 user = User.objects.get(id=self.session['user_id'])
184 188 if user.is_veteran():
185 189 posting_delay = VETERAN_POSTING_DELAY
@@ -427,7 +427,9 b' class Thread(models.Model):'
427 427 Gets sorted thread posts
428 428 """
429 429
430 return self.replies.all().order_by('pub_time')
430 # return self.replies.all().order_by('pub_time')
431 return self.replies.all().order_by('pub_time').prefetch_related(
432 'referenced_posts')
431 433
432 434 def add_tag(self, tag):
433 435 """
@@ -68,7 +68,7 b''
68 68 {{ post.text.rendered }}
69 69 {% endif %}
70 70 {% endautoescape %}
71 {% with refposts=post.get_sorted_referenced_posts %}
71 {% with refposts=post.referenced_posts.all %}
72 72 {% if refposts %}
73 73 <div class="refmap">
74 74 {% trans "Replies" %}:
General Comments 0
You need to be logged in to leave comments. Login now