Don't send admin email if IncompletePaymentIntent lookup doesn't contain a value

This commit is contained in:
PCoder 2021-01-01 11:17:07 +05:30
parent 8deed169ca
commit 1d7c3f424c

View file

@ -289,11 +289,11 @@ def handle_webhook(request):
billing_address_data=billing_address_data billing_address_data=billing_address_data
) )
incomplete_pm.save() incomplete_pm.save()
except (IncompletePaymentIntents.DoesNotExist, except IncompletePaymentIntents.DoesNotExist as ex:
IncompletePaymentIntents.MultipleObjectsReturned, logger.error(str(ex))
except (IncompletePaymentIntents.MultipleObjectsReturned,
Exception) as ex: Exception) as ex:
logger.error(str(ex)) logger.error(str(ex))
logger.debug(str(ex))
email_data = { email_data = {
'subject': "IncompletePaymentIntents error", 'subject': "IncompletePaymentIntents error",
'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS,