Skip to content

Commit c2d9491

Browse files
authored
Fix case where rtd_product is not defined. (#12550)
Fixes https://read-the-docs.sentry.io/issues/6918806178/?project=161479
1 parent 4ef4abe commit c2d9491

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

readthedocs/subscriptions/views.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ def get_context_data(self, **kwargs):
119119
features = {}
120120
for item in stripe_subscription.items.all().select_related("price__product"):
121121
rtd_product = get_product(item.price.product.id)
122+
if not rtd_product:
123+
# Skip products that are not defined in RTD_PRODUCTS
124+
log.warning(
125+
"Product not found in RTD_PRODUCTS",
126+
stripe_product_id=item.price.product.id,
127+
)
128+
continue
129+
122130
product = {
123131
"stripe_price": item.price,
124132
"quantity": item.quantity,

0 commit comments

Comments
 (0)