Use last event when editing a comment, not only

This commit is contained in:
Drew DeVault 2020-09-03 11:09:54 -04:00
parent 809e294ef0
commit 2687448c09
1 changed files with 3 additions and 1 deletions

View File

@ -263,7 +263,9 @@ def ticket_comment_edit_POST(owner, name, ticket_id, comment_id):
})
return render_template("edit-comment.html", comment=comment, **ctx)
event = Event.query.filter(Event.comment_id == comment.id).one_or_none()
event = (Event.query
.filter(Event.comment_id == comment.id)
.order_by(Event.id.desc())).first()
assert event is not None
new_comment = TicketComment()