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})}