fix wrong url redirect on thread create
This commit is contained in:
parent
f071919fa8
commit
f3aaa6d24d
@ -35,10 +35,10 @@ app:post("thread_create", "/create", function(self)
|
|||||||
end
|
end
|
||||||
local topic = Topics:find(self.params.topic_id)
|
local topic = Topics:find(self.params.topic_id)
|
||||||
if not topic then
|
if not topic then
|
||||||
return {redirect_to = self:url_for("topics")}
|
return {redirect_to = self:url_for("all_topics")}
|
||||||
end
|
end
|
||||||
if util.is_topic_locked(topic) then
|
if util.is_topic_locked(topic) and not user:is_mod() then
|
||||||
return {redirect_to = self:url_for("topics")}
|
return {redirect_to = self:url_for("all_topics")}
|
||||||
end
|
end
|
||||||
|
|
||||||
local title = lapis_util.trim(self.params.title)
|
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)
|
local post = util.create_post(thread.id, user.id, post_content)
|
||||||
if not post then
|
if not post then
|
||||||
return {redirect_to = self:url_for("topics")}
|
return {redirect_to = self:url_for("all_topics")}
|
||||||
end
|
end
|
||||||
|
|
||||||
return {redirect_to = self:url_for("thread", {slug = slug})}
|
return {redirect_to = self:url_for("thread", {slug = slug})}
|
||||||
|
Loading…
Reference in New Issue
Block a user