diff --git a/app_users/models.py b/app_users/models.py index 4c7e716e2..9299fba47 100644 --- a/app_users/models.py +++ b/app_users/models.py @@ -209,7 +209,11 @@ def search_stripe_customer(self) -> stripe.Customer | None: if not self.uid: return None if self.stripe_customer_id: - return stripe.Customer.retrieve(self.stripe_customer_id) + try: + return stripe.Customer.retrieve(self.stripe_customer_id) + except stripe.error.InvalidRequestError as e: + if e.http_status != 404: + raise try: customer = stripe.Customer.search( query=f'metadata["uid"]:"{self.uid}"'