forked from CGM_Public/pretix_original
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):
|
def api_payment_details(self, payment: OrderPayment):
|
||||||
from .models import GiftCard
|
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 {
|
return {
|
||||||
'gift_card': {
|
'gift_card': {
|
||||||
'id': gc.pk,
|
'id': gc.pk,
|
||||||
|
|||||||
Reference in New Issue
Block a user