Do not allow orders with unavailable items to be completed

This commit is contained in:
Raphael Michel
2018-11-13 17:55:56 +01:00
parent 0734715bab
commit 8ffc6550da
2 changed files with 16 additions and 2 deletions

View File

@@ -377,7 +377,7 @@ def _check_positions(event: Event, now_dt: datetime, positions: List[CartPositio
products_seen = Counter()
for i, cp in enumerate(positions):
if not cp.item.active or (cp.variation and not cp.variation.active):
if not cp.item.is_available() or (cp.variation and not cp.variation.active):
err = err or error_messages['unavailable']
cp.delete()
continue