Combine conditionals to single line

This commit is contained in:
Martin Whitehouse 2022-07-25 03:22:59 +02:00
parent f815ebbb5c
commit fe619b5ff2
No known key found for this signature in database
GPG Key ID: 3FCE1D3E9DEC09C1

View File

@ -728,9 +728,12 @@ def update_ticket(request, ticket_id, public=False):
c.save()
ticket.due_date = due_date
if new_status in (Ticket.RESOLVED_STATUS, Ticket.CLOSED_STATUS):
if new_status == Ticket.RESOLVED_STATUS or ticket.resolution is None:
ticket.resolution = comment
if new_status in (
Ticket.RESOLVED_STATUS, Ticket.CLOSED_STATUS
) and (
new_status == Ticket.RESOLVED_STATUS or ticket.resolution is None
):
ticket.resolution = comment
# ticket might have changed above, so we re-instantiate context with the
# (possibly) updated ticket.