Adjust to new pretix-resellers branch

This commit is contained in:
Raphael Michel 2020-09-26 19:14:21 +02:00
parent 62c632e3af
commit c1700682b9

View file

@ -88,7 +88,8 @@ def cart_fee(sender: Event, request: HttpRequest, invoice_address, total, **kwar
else: else:
try: try:
reseller, user = get_reseller_and_user(request) reseller, user = get_reseller_and_user(request)
if getattr(reseller, 'do_not_charge_service_fees', False): config = reseller.configs.get(organizer_id=sender.organizer_id)
if config.skip_default_service_fees:
return [] return []
except ResellerException: except ResellerException:
pass pass
@ -108,7 +109,8 @@ def order_fee(sender: Event, positions, invoice_address, total, meta_info, gift_
pass pass
else: else:
r = Reseller.objects.get(pk=meta_info.get('servicefees_reseller_id')) r = Reseller.objects.get(pk=meta_info.get('servicefees_reseller_id'))
if getattr(r, 'do_not_charge_service_fees', False): config = r.configs.get(organizer_id=sender.organizer_id)
if config.skip_default_service_fees:
return [] return []
return get_fees(sender, total, invoice_address, mod, positions=positions, gift_cards=gift_cards) return get_fees(sender, total, invoice_address, mod, positions=positions, gift_cards=gift_cards)