Do not allow to pay gift cards with gift cards

This commit is contained in:
Raphael Michel
2019-10-17 18:12:06 +02:00
parent 4b2f25ce8a
commit 1fe93ac6b7
2 changed files with 17 additions and 1 deletions

View File

@@ -607,6 +607,8 @@ def _create_order(event: Event, email: str, positions: List[CartPosition], now_d
if not gc.accepted_by(event.organizer):
raise OrderError(_("This gift card is not accepted by this event organizer."))
checked_gift_cards.append(gc)
if checked_gift_cards and any(c.item.issue_giftcard for c in positions):
raise OrderError(_("You cannot pay with gift cards when buying a gift card."))
fees, pf, gift_card_values = _get_fees(positions, payment_provider, address, meta_info, event, checked_gift_cards)
total = pending_sum = sum([c.price for c in positions]) + sum([c.value for c in fees])