From 1d7c3f424cbd9ecc9c060279739e589654122d13 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 1 Jan 2021 11:17:07 +0530 Subject: [PATCH] Don't send admin email if IncompletePaymentIntent lookup doesn't contain a value --- webhook/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webhook/views.py b/webhook/views.py index 34e668ee..0a96d0b6 100644 --- a/webhook/views.py +++ b/webhook/views.py @@ -289,11 +289,11 @@ def handle_webhook(request): billing_address_data=billing_address_data ) incomplete_pm.save() - except (IncompletePaymentIntents.DoesNotExist, - IncompletePaymentIntents.MultipleObjectsReturned, + except IncompletePaymentIntents.DoesNotExist as ex: + logger.error(str(ex)) + except (IncompletePaymentIntents.MultipleObjectsReturned, Exception) as ex: logger.error(str(ex)) - logger.debug(str(ex)) email_data = { 'subject': "IncompletePaymentIntents error", 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS,