From 9b2f23fcc5a180b83c746339290695fe7dd006d9 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 31 Jul 2021 07:39:18 +0530 Subject: [PATCH] Logged warning to console if Business icon and/or logo cannot be retrieved --- djstripe/models/account.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/djstripe/models/account.py b/djstripe/models/account.py index 7d109d851b..ad2582431d 100644 --- a/djstripe/models/account.py +++ b/djstripe/models/account.py @@ -6,7 +6,7 @@ from ..fields import JSONField, StripeCurrencyCodeField, StripeEnumField from ..settings import djstripe_settings from .api import APIKey -from .base import StripeModel +from .base import StripeModel, logger class Account(StripeModel): @@ -201,7 +201,9 @@ def _attach_objects_post_save_hook(self, cls, data, pending_relations=None): ) except stripe.error.PermissionError: # No permission to retrieve the data with the key - pass + logger.warning( + f"Cannot retrieve business branding {field} for acct {self.id} with the key." + ) except stripe.error.InvalidRequestError as e: if "a similar object exists in" in str(e): # HACK around a Stripe bug.