From b498d45621f0cf8097d209d1ed83406da3bcd0df Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 2 Apr 2020 09:50:44 +0200 Subject: [PATCH] Pass gift_cards to order_fee_calculation --- src/pretix/base/services/orders.py | 2 +- src/pretix/base/signals.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pretix/base/services/orders.py b/src/pretix/base/services/orders.py index 7a8f674f1f..0a71703156 100644 --- a/src/pretix/base/services/orders.py +++ b/src/pretix/base/services/orders.py @@ -691,7 +691,7 @@ def _get_fees(positions: List[CartPosition], payment_provider: BasePaymentProvid total = sum([c.price for c in positions]) for recv, resp in order_fee_calculation.send(sender=event, invoice_address=address, total=total, - meta_info=meta_info, positions=positions): + meta_info=meta_info, positions=positions, gift_cards=gift_cards): if resp: fees += resp total += sum(f.value for f in fees) diff --git a/src/pretix/base/signals.py b/src/pretix/base/signals.py index 3f305d6752..cdae79e8a8 100644 --- a/src/pretix/base/signals.py +++ b/src/pretix/base/signals.py @@ -527,7 +527,7 @@ an OrderedDict of (setting name, form field). """ order_fee_calculation = EventPluginSignal( - providing_args=['positions', 'invoice_address', 'meta_info', 'total'] + providing_args=['positions', 'invoice_address', 'meta_info', 'total', 'gift_cards'] ) """ This signals allows you to add fees to an order while it is being created. You are expected to @@ -538,7 +538,8 @@ As with all plugin signals, the ``sender`` keyword argument will contain the eve argument will contain the cart positions and ``invoice_address`` the invoice address (useful for tax calculation). The argument ``meta_info`` contains the order's meta dictionary. The ``total`` keyword argument will contain the total cart sum without any fees. You should not rely on this -``total`` value for fee calculations as other fees might interfere. +``total`` value for fee calculations as other fees might interfere. The ``gift_cards`` argument lists +the gift cards in use. """ order_fee_type_name = EventPluginSignal(