From f3aaa6d24d23ae2b35615200acab164e39db8d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Fri, 23 May 2025 16:12:09 +0300 Subject: [PATCH] fix wrong url redirect on thread create --- apps/threads.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/threads.lua b/apps/threads.lua index 271c875..871921f 100644 --- a/apps/threads.lua +++ b/apps/threads.lua @@ -35,10 +35,10 @@ app:post("thread_create", "/create", function(self) end local topic = Topics:find(self.params.topic_id) if not topic then - return {redirect_to = self:url_for("topics")} + return {redirect_to = self:url_for("all_topics")} end - if util.is_topic_locked(topic) then - return {redirect_to = self:url_for("topics")} + if util.is_topic_locked(topic) and not user:is_mod() then + return {redirect_to = self:url_for("all_topics")} end local title = lapis_util.trim(self.params.title) @@ -57,7 +57,7 @@ app:post("thread_create", "/create", function(self) local post = util.create_post(thread.id, user.id, post_content) if not post then - return {redirect_to = self:url_for("topics")} + return {redirect_to = self:url_for("all_topics")} end return {redirect_to = self:url_for("thread", {slug = slug})}