Skip to content

Commit 4ef4abe

Browse files
authored
Properly return when no org found (#12552)
We were hitting an exception on the organization.email, if there wasn't an organization. Fixes https://read-the-docs.sentry.io/issues/6978188036
1 parent e42677d commit 4ef4abe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

readthedocs/subscriptions/event_handlers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ def customer_updated_event(event, **kwargs):
309309
organization = Organization.objects.filter(stripe_id=stripe_customer["id"]).first()
310310
if not organization:
311311
log.error("Customer isn't attached to an organization.")
312+
return
312313

313314
new_email = stripe_customer["email"]
314315
if organization.email != new_email:

0 commit comments

Comments
 (0)