Order tickets in account page.

This commit is contained in:
Víðir Valberg Guðmundsson 2019-07-29 21:16:48 +02:00
parent b7feb96c9b
commit 5d3cfe6210
2 changed files with 6 additions and 2 deletions

View file

@ -23,9 +23,13 @@
Checked in
<th>
Actions
<tbody>
{% for ticket in tickets %}
{% ifchanged ticket.ticket_type.camp %}
<tr>
<td colspan="5">
<strong>{{ ticket.ticket_type.camp }}</strong>
{% endifchanged %}
<tr>
<td>
{% if ticket.name %}

View file

@ -19,7 +19,7 @@ class ShopTicketListView(LoginRequiredMixin, ListView):
def get_queryset(self):
tickets = super(ShopTicketListView, self).get_queryset()
user = self.request.user
return tickets.filter(order__user=user)
return tickets.filter(order__user=user).order_by("ticket_type__camp")
class ShopTicketDownloadView(LoginRequiredMixin, SingleObjectMixin, View):