fix sorting

master
Fox Wilson 2016-05-27 22:48:57 -04:00
parent 97ad7d6302
commit dbb9bb5953
2 changed files with 2 additions and 2 deletions

2
app.py
View File

@ -302,7 +302,7 @@ def team_ticket_detail(ticket):
flash("That's not your ticket.")
return redirect(url_for("team_tickets"))
comments = TicketComment.select().where(TicketComment.ticket == ticket).order_by(TicketComment.time.desc())
comments = TicketComment.select().where(TicketComment.ticket == ticket).order_by(TicketComment.time)
return render_template("ticket_detail.html", ticket=ticket, comments=comments)
@app.route('/tickets/<int:ticket>/comment/', methods=["POST"])

View File

@ -63,7 +63,7 @@ def admin_tickets():
@admin_required
def admin_ticket_detail(ticket):
ticket = TroubleTicket.get(TroubleTicket.id == ticket)
comments = list(TicketComment.select().where(TicketComment.ticket == ticket))
comments = list(TicketComment.select().where(TicketComment.ticket == ticket).order_by(TicketComment.time))
return render_template("admin/ticket_detail.html", ticket=ticket, comments=comments)
@admin.route("/tickets/<int:ticket>/comment/", methods=["POST"])