From 32ac6640ab181d01227f51e37e3d67599d0b1fe4 Mon Sep 17 00:00:00 2001 From: Skia Date: Tue, 30 May 2017 23:23:51 +0200 Subject: [PATCH] Small fix with forum topic titles Signed-off-by: Skia --- forum/models.py | 2 +- forum/templates/forum/macros.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/forum/models.py b/forum/models.py index 2ddcc061..9f0f76e5 100644 --- a/forum/models.py +++ b/forum/models.py @@ -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() diff --git a/forum/templates/forum/macros.jinja b/forum/templates/forum/macros.jinja index c423bba4..159a1cbf 100644 --- a/forum/templates/forum/macros.jinja +++ b/forum/templates/forum/macros.jinja @@ -54,7 +54,7 @@ {% else %} {% endif %} -
{{ topic.title }}
+
{{ topic.title or topic.messages.first().title }}

{{ topic.description }}

{% if user.can_edit(topic) %}