forked from osmarks/xenotime
Ignore empty messages
This commit is contained in:
parent
5ad0e0927c
commit
b2beb40444
@ -135,6 +135,10 @@ proc newThreadForm(ctx: AppContext) {.async.} =
|
||||
|
||||
proc submitPost(ctx: AppContext) {.async.} =
|
||||
let title = ctx.getFormParams("thread-title")
|
||||
if ctx.getFormParams("content") == "" or (title == "" and ctx.getFormParams("thread-id") == ""):
|
||||
ctx.flash("Please actually have content.", FlashLevel.Warning)
|
||||
resp redirect(ctx.request.headers["referer"], Http303)
|
||||
return
|
||||
if ctx.user.isSome:
|
||||
ctx.db.transaction:
|
||||
let threadID = if title != "": domain.postThread(ctx.db, title, ctx.user.get.id)
|
||||
|
Loading…
Reference in New Issue
Block a user