From f9c4d051210312c1edc0a0fc350292be7ed8e641 Mon Sep 17 00:00:00 2001 From: Eragon Date: Sat, 9 Mar 2024 16:15:52 +0100 Subject: [PATCH] Allow any post to be set as main post #130 --- app/models/user.py | 2 +- app/templates/forum/topic.html | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/user.py b/app/models/user.py index 5148117..37baf04 100644 --- a/app/models/user.py +++ b/app/models/user.py @@ -261,7 +261,7 @@ class Member(User): if comment.type != "comment": return False post = comment.thread.owner_post - return self.can_edit_post(post) and (comment.author == post.author) + return self.can_edit_post(post) def can_lock_thread(self, post): """Whether this member can lock the thread associated with the post""" diff --git a/app/templates/forum/topic.html b/app/templates/forum/topic.html index 64a472d..86db5ea 100644 --- a/app/templates/forum/topic.html +++ b/app/templates/forum/topic.html @@ -24,6 +24,9 @@
Créé le {{ t.date_created | dyndate }} + {% if t.author_id != t.thread.top_comment.author.id %} + par {{ t.author.name }} + {% endif %} {% if t.thread.top_comment.date_created | dyndate != t.date_created | dyndate %} (Posté le {{ t.thread.top_comment.date_created | dyndate }})