mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Fix crash if gift card does not exist
This commit is contained in:
@@ -1062,7 +1062,10 @@ class GiftCardPayment(BasePaymentProvider):
|
||||
|
||||
def api_payment_details(self, payment: OrderPayment):
|
||||
from .models import GiftCard
|
||||
gc = GiftCard.objects.get(pk=payment.info_data.get('gift_card'))
|
||||
try:
|
||||
gc = GiftCard.objects.get(pk=payment.info_data.get('gift_card'))
|
||||
except GiftCard.DoesNotExist:
|
||||
return {}
|
||||
return {
|
||||
'gift_card': {
|
||||
'id': gc.pk,
|
||||
|
||||
Reference in New Issue
Block a user