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 Checked in
<th> <th>
Actions Actions
<tbody> <tbody>
{% for ticket in tickets %} {% for ticket in tickets %}
{% ifchanged ticket.ticket_type.camp %}
<tr>
<td colspan="5">
<strong>{{ ticket.ticket_type.camp }}</strong>
{% endifchanged %}
<tr> <tr>
<td> <td>
{% if ticket.name %} {% if ticket.name %}

View file

@ -19,7 +19,7 @@ class ShopTicketListView(LoginRequiredMixin, ListView):
def get_queryset(self): def get_queryset(self):
tickets = super(ShopTicketListView, self).get_queryset() tickets = super(ShopTicketListView, self).get_queryset()
user = self.request.user 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): class ShopTicketDownloadView(LoginRequiredMixin, SingleObjectMixin, View):