limit length of new comments

same constraint in editing a comment
This commit is contained in:
Jackson Chen 2023-09-24 21:13:59 +02:00 committed by Drew DeVault
parent 4bddb933ad
commit 3f51bbe5ff
1 changed files with 3 additions and 0 deletions

View File

@ -164,6 +164,9 @@ def ticket_comment_POST(owner, name, ticket_id):
abort(403)
else:
text = valid.require("comment")
valid.expect(not text or 3 <= len(text) <= 16384,
"Comment must be between 3 and 16384 characters.",
field="comment")
if resolve:
try: