def admin_ticket_detail(ticket): ticket = TroubleTicket.get(TroubleTicket.id == ticket) comments = list(TicketComment.select().where( TicketComment.ticket == ticket).order_by(TicketComment.time)) return render_template("admin/ticket_detail.html", ticket=ticket, comments=comments)
def team_ticket_detail(ticket): try: ticket = TroubleTicket.get(TroubleTicket.id == ticket) except TroubleTicket.DoesNotExist: flash("Could not find ticket #{}.".format(ticket)) return redirect(url_for("team_tickets")) if ticket.team != g.team: flash("That is not your ticket.") return redirect(url_for("team_tickets")) comments = TicketComment.select().where(TicketComment.ticket == ticket).order_by(TicketComment.time) return render_template("ticket_detail.html", ticket=ticket, comments=comments)
def team_ticket_detail(ticket): try: ticket = TroubleTicket.get(TroubleTicket.id == ticket) except TroubleTicket.DoesNotExist: flash("Couldn't find ticket #{}.".format(ticket)) return redirect(url_for("team_tickets")) if ticket.team != g.team: flash("That's not your ticket.") return redirect(url_for("team_tickets")) comments = TicketComment.select().where(TicketComment.ticket == ticket).order_by(TicketComment.time.desc()) return render_template("ticket_detail.html", ticket=ticket, comments=comments)
def admin_ticket_detail(ticket): ticket = TroubleTicket.get(TroubleTicket.id == ticket) comments = list(TicketComment.select().where(TicketComment.ticket == ticket)) return render_template("admin/ticket_detail.html", ticket=ticket, comments=comments)