Small fix with forum topic titles

Signed-off-by: Skia <skia@libskia.so>
This commit is contained in:
Skia 2017-05-30 23:23:51 +02:00
parent 06b67f1d27
commit 32ac6640ab
2 changed files with 2 additions and 2 deletions

View File

@ -246,7 +246,7 @@ class ForumMessage(models.Model):
super(ForumMessage, self).save(*args, **kwargs)
if self.is_last_in_topic():
self.topic._last_message_id = self.id
if self.is_first_in_topic():
if self.is_first_in_topic() and self.title:
self.topic._title = self.title
self.topic._message_number = self.topic.messages.count()
self.topic.save()

View File

@ -54,7 +54,7 @@
{% else %}
<a class="ib w_big" href="{{ url('forum:view_topic', topic_id=topic.id) }}">
{% endif %}
<div class="title">{{ topic.title }}</div>
<div class="title">{{ topic.title or topic.messages.first().title }}</div>
<p>{{ topic.description }}</p>
</a>
{% if user.can_edit(topic) %}