aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-25 12:10:41 -0600
committerColin Okay <okay@toyful.space>2022-02-25 12:10:41 -0600
commitbe072cfd8b13114d9644f46217871b7d02d4fea7 (patch)
treedc1c3b6b5adee4d103e1a55bf6a9c36019f60d92 /src
parent3f1b479c8233bea2f4159957441edfce76997e3f (diff)
limiting explanation length
Diffstat (limited to 'src')
-rw-r--r--src/main.lisp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.lisp b/src/main.lisp
index 27afeda..26df348 100644
--- a/src/main.lisp
+++ b/src/main.lisp
@@ -519,9 +519,11 @@ have exceeded the invite limit."
"On success, return an object containing a new [invite token](#invite-token)."
(to-json (make-new-invite (api-contributor token))))
+(defparameter +explanation-wordcount-limit+ 550)
+
(defun validate-new-oneliner-plist (plist)
(with-plist
- (oneliner tags brief runstyle) plist
+ (oneliner tags brief runstyle explanation) plist
(unless tags
(http-err 400 "A oneliner requires tags"))
(unless brief
@@ -530,6 +532,9 @@ have exceeded the invite limit."
(http-err 400 "Brief description is too long. Limit to 75 characters"))
(unless oneliner
(http-err 400 "Oneliner cannot be blank"))
+ (when explanation
+ (unless (<= (count #\space explanation) +explanation-wordcount-limit+)
+ (http-err 400 "Explanation is too long. Limit to around 500 words.")))
(when runstyle
(setf runstyle (a:make-keyword runstyle))
(unless (typep runstyle 'runstyle)