feat(web/panettone): Disallow comments with an empty body
Change-Id: Ic77a0caf419389e8460bf7e5688293f3a588caa4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1405 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
This commit is contained in:
parent
943a4c9214
commit
add588e634
1 changed files with 14 additions and 10 deletions
|
@ -429,6 +429,10 @@ updated issue"
|
|||
("/issues/:id/comments" :decorators (@auth)
|
||||
:method :post)
|
||||
(&path (id 'integer) &post body)
|
||||
(flet ((redirect-to-issue ()
|
||||
(hunchentoot:redirect (format nil "/issues/~A" id))))
|
||||
(if (string= body "")
|
||||
(redirect-to-issue)
|
||||
(handler-case
|
||||
(progn
|
||||
(cl-prevalence:execute-transaction
|
||||
|
@ -436,9 +440,9 @@ updated issue"
|
|||
:body body
|
||||
:author-dn (dn *user*)))
|
||||
(cl-prevalence:snapshot *p-system*)
|
||||
(hunchentoot:redirect (format nil "/issues/~A" id)))
|
||||
(redirect-to-issue))
|
||||
(issue-not-found (_)
|
||||
(render/not-found "Issue"))))
|
||||
(render/not-found "Issue"))))))
|
||||
|
||||
(defroute close-issue
|
||||
("/issues/:id/close" :decorators (@auth)
|
||||
|
|
Loading…
Reference in a new issue