@@ -344,12 +344,11 @@ def list(self, request, *args, **kwargs):
344344 },
345345 )
346346 def retrieve (self , request , * args , ** kwargs ):
347- # Try normal lookup by slug first. If not found, allow fallback lookup where
348- # the provided slug corresponds to a configured SSP product key in
349- # `settings.SSP_PRODUCTS`. In that case, find the SspProduct by its
350- # configured `lookup_key` so routes like
347+ # Try normal lookup by DB slug first. If not found, attempt fallback resolution where
348+ # the provided path segment might be a Stripe Price lookup_key (or an alias that can be
349+ # resolved to one via Stripe metadata). This supports routes like:
351350 # `/api/v1/ssp-products/essentials_tech_and_digital_transformation/`
352- # resolve correctly even when the DB `slug` differs.
351+ # even when the DB `slug` differs.
353352 try :
354353 product = self .get_object ()
355354 except (exceptions .NotFound , Http404 ) as exc :
@@ -365,9 +364,8 @@ def retrieve(self, request, *args, **kwargs):
365364 # First, check whether the requested slug actually matches a
366365 # database `stripe_price_lookup_key`. This allows direct lookup_key
367366 # URLs (where slug==lookup_key) to resolve without calling Stripe.
368- product = SspProduct . objects .filter (
367+ product = self . get_queryset () .filter (
369368 stripe_price_lookup_key = requested_slug ,
370- is_active = True ,
371369 ).first ()
372370 logger .debug ('DB lookup for stripe_price_lookup_key=%s returned %s' , requested_slug , bool (product ))
373371
@@ -427,9 +425,8 @@ def retrieve(self, request, *args, **kwargs):
427425 lookup_key_candidate = None
428426
429427 if not product and lookup_key_candidate :
430- product = SspProduct . objects .filter (
428+ product = self . get_queryset () .filter (
431429 stripe_price_lookup_key = lookup_key_candidate ,
432- is_active = True ,
433430 ).first ()
434431
435432 # If no product was resolved via Stripe lookups, raise NotFound.
0 commit comments