Fix #91 -- Make products/orders that are not cancelable (#204)

* Make products/orders that are not cancellable
Update Unit Tests

* Make use of select_related instead of prefetch_related
Simplify cancellable logic
Migrations

* Simplify cancellable logic
Maske use of select_related instead of prefetch_related

* Fix cancelable condition bug
This commit is contained in:
Enrique Saez
2016-09-01 08:55:02 +02:00
committed by Raphael Michel
parent 022e02d913
commit 841cfe52a2
8 changed files with 114 additions and 1 deletions

View File

@@ -243,7 +243,9 @@ class Order(LoggedModel):
@property
def can_user_cancel(self) -> bool:
return self.event.settings.cancel_allow_user
positions = self.positions.all().select_related('item')
cancelable = all([op.item.allow_cancel for op in positions])
return self.event.settings.cancel_allow_user and cancelable
@property
def is_expired_by_time(self):