Commit 32ac6640 authored by Skia's avatar Skia

Small fix with forum topic titles

Signed-off-by: Skia's avatarSkia <skia@libskia.so>
parent 06b67f1d
...@@ -246,7 +246,7 @@ class ForumMessage(models.Model): ...@@ -246,7 +246,7 @@ class ForumMessage(models.Model):
super(ForumMessage, self).save(*args, **kwargs) super(ForumMessage, self).save(*args, **kwargs)
if self.is_last_in_topic(): if self.is_last_in_topic():
self.topic._last_message_id = self.id 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._title = self.title
self.topic._message_number = self.topic.messages.count() self.topic._message_number = self.topic.messages.count()
self.topic.save() self.topic.save()
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
{% else %} {% else %}
<a class="ib w_big" href="{{ url('forum:view_topic', topic_id=topic.id) }}"> <a class="ib w_big" href="{{ url('forum:view_topic', topic_id=topic.id) }}">
{% endif %} {% endif %}
<div class="title">{{ topic.title }}</div> <div class="title">{{ topic.title or topic.messages.first().title }}</div>
<p>{{ topic.description }}</p> <p>{{ topic.description }}</p>
</a> </a>
{% if user.can_edit(topic) %} {% if user.can_edit(topic) %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment