Allow to enable ticket downloads for pending orders

This commit is contained in:
Raphael Michel
2018-10-03 12:11:06 +02:00
parent 4b8d4b4792
commit 0dbcfdc5ac
10 changed files with 93 additions and 46 deletions

View File

@@ -420,6 +420,20 @@ class Order(LoggedModel):
dl_date = dl_date.datetime(self.event)
return dl_date
@property
def ticket_download_available(self):
return self.event.settings.ticket_download and (
self.event.settings.ticket_download_date is None
or now() > self.ticket_download_date
) and (
self.status == Order.STATUS_PAID
or (
(self.event.settings.ticket_download_pending or self.total == Decimal("0.00")) and
self.status == Order.STATUS_PENDING and
not self.require_approval
)
)
@property
def payment_term_last(self):
tz = pytz.timezone(self.event.settings.timezone)