require comment except for close/reopen

This commit is contained in:
Jackson Chen 2023-09-24 21:13:58 +02:00 committed by Drew DeVault
parent a297b4254d
commit 4bddb933ad
1 changed files with 5 additions and 2 deletions

View File

@ -159,8 +159,11 @@ def ticket_comment_POST(owner, name, ticket_id):
reopen = valid.optional("reopen")
preview = valid.optional("preview")
if (resolve or reopen) and TicketAccess.edit not in access:
abort(403)
if (resolve or reopen):
if TicketAccess.edit not in access:
abort(403)
else:
text = valid.require("comment")
if resolve:
try: