Fix wrongly displayed download buttons

This commit is contained in:
Raphael Michel
2017-07-24 09:14:54 +02:00
parent 39179971c5
commit d2d77f28aa
2 changed files with 5 additions and 2 deletions

View File

@@ -130,7 +130,7 @@
{% endif %}
{% endif %}
</div>
{% if download %}
{% if download and line.item.admission|default:event.settings.ticket_download_nonadm %}
<div class="download-mobile">
{% if not line.addon_to or event.settings.ticket_download_addons %}
{% for b in download_buttons %}

View File

@@ -94,12 +94,15 @@ class OrderDetails(EventViewMixin, OrderDetailMixin, CartMixin, TemplateView):
) and self.order.status == Order.STATUS_PAID
)
ctx['download_buttons'] = self.download_buttons
ctx['can_download_multi'] = any([b['multi'] for b in self.download_buttons])
ctx['cart'] = self.get_cart(
answers=True, downloads=ctx['can_download'],
queryset=self.order.positions.all(),
payment_fee=self.order.payment_fee, payment_fee_tax_rate=self.order.payment_fee_tax_rate
)
ctx['can_download_multi'] = any([b['multi'] for b in self.download_buttons]) and (
self.request.event.settings.ticket_download_nonadm or
any([p.item.admission for p in ctx['cart']['positions']])
)
ctx['invoices'] = list(self.order.invoices.all())
ctx['can_generate_invoice'] = invoice_qualified(self.order) and (
self.request.event.settings.invoice_generate == 'user'