@@ -382,6 +382,7 @@ async def get_billing_portal_url(
382382 return SubscriptionPortalUrlResponse ()
383383
384384 async def get_execution_minutes_price (self , org : Organization ):
385+ """Fetch price for addon execution minutes from external subscription app"""
385386 if not org .subscription :
386387 raise HTTPException (
387388 status_code = 404 , detail = "Organization has no subscription"
@@ -399,10 +400,12 @@ async def get_execution_minutes_price(self, org: Organization):
399400 ) as resp :
400401 text = await resp .text ()
401402 return AddonMinutesPricing .model_validate_json (text )
403+ # pylint: disable=broad-exception-caught
402404 except Exception as exc :
403405 print ("Error fetching checkout url" , exc )
404406
405407 async def get_checkout_url (self , org : Organization , minutes : int | None ):
408+ """Create checkout url for additional minutes"""
406409 if not org .subscription :
407410 raise HTTPException (
408411 status_code = 404 , detail = "Organization has no subscription"
@@ -426,11 +429,12 @@ async def get_checkout_url(self, org: Organization, minutes: int | None):
426429 ) as resp :
427430 text = await resp .text ()
428431 return CheckoutAddonMinutesResponse .model_validate_json (text )
432+ # pylint: disable=broad-exception-caught
429433 except Exception as exc :
430434 print ("Error fetching checkout url" , exc )
431435
432436
433- # pylint: disable=invalid-name,too-many-arguments
437+ # pylint: disable=invalid-name,too-many-arguments,too-many-locals
434438def init_subs_api (
435439 app ,
436440 mdb ,
@@ -555,7 +559,7 @@ async def get_billing_portal_url(
555559 @org_ops .router .get (
556560 "/price/execution-minutes" ,
557561 tags = ["organizations" ],
558- response_model = PriceResponse ,
562+ response_model = AddonMinutesPricing ,
559563 )
560564 async def get_execution_minutes_price (
561565 org : Organization = Depends (org_ops .org_owner_dep ),
@@ -567,7 +571,7 @@ async def get_execution_minutes_price(
567571 tags = ["organizations" ],
568572 response_model = CheckoutAddonMinutesResponse ,
569573 )
570- async def get_billing_portal_url (
574+ async def get_execution_minutes_checkout_url (
571575 minutes : int | None = None ,
572576 org : Organization = Depends (org_ops .org_owner_dep ),
573577 ):
0 commit comments