mirror of
https://github.com/pretix/pretix.git
synced 2026-08-23 12:51:59 +00:00
Check-in API: Add reusable media exchange (#6115)
* Add Reusable Media Exchange to Checkin API * isort * Remove debugging leftover * Apply suggestions from code review Co-authored-by: robbi5 <maxi@richt.name> * Add media_exchange_supported to CheckinRPCRedeemInputSerializer * SecurityProfiles: Add api-v1:reusablemedia-lookup and -detail for SCAN * Simplify media exchange checks * Apply suggestions from code review Co-authored-by: Raphael Michel <mail@raphaelmichel.de> * Wording: re-usable --> reusable * Deny checkins if media-exchange is required but device does not support it. * Remove media_exchange_supported-Flag: Checkin will always be denied if media needs to be exchanged; apps will fall back to explanation text * CheckinRPC: Also perform media exchange * Use media_policy from item, not as a checkinrpc parameter * my own review notes * Fixes, cleanup, rebase * block expired media * Fix query * add logging * Refactor link_action into media policy, gift card support * Block illegal policy-type combination * Drop add_to_reusable_medium, decide all by policy * Fix test failure * fix test on postgres * Expose reusable_media_usage_enforced to devies * Explicitly set update view --------- Co-authored-by: robbi5 <maxi@richt.name> Co-authored-by: Maximilian Richt <richt@pretix.eu> Co-authored-by: Raphael Michel <mail@raphaelmichel.de> Co-authored-by: Raphael Michel <michel@rami.io> Co-authored-by: Raphael Michel <michel@pretix.eu>
This commit is contained in:
co-authored by
robbi5
Raphael Michel
Maximilian Richt
Raphael Michel
Raphael Michel
parent
784577d86f
commit
775fdd1ccb
@@ -4123,8 +4123,8 @@ def test_giftcard_multiple(event):
|
||||
for p in order.payments.all():
|
||||
p.payment_provider.execute_payment(None, p)
|
||||
|
||||
assert order.payments.get(info__icontains=gc1.pk).amount == Decimal('12.00')
|
||||
assert order.payments.get(info__icontains=gc2.pk).amount == Decimal('11.00')
|
||||
assert order.payments.get(amount=Decimal("12.00")).info_data["gift_card"] == gc1.pk
|
||||
assert order.payments.get(amount=Decimal("11.00")).info_data["gift_card"] == gc2.pk
|
||||
gc1 = GiftCard.objects.get(pk=gc1.pk)
|
||||
assert gc1.value == 0
|
||||
gc2 = GiftCard.objects.get(pk=gc2.pk)
|
||||
|
||||
Reference in New Issue
Block a user