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
|
||||
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})}
|
||||
|
Loading…
Reference in New Issue
Block a user