An open source, non-profit web search engine
Fix polar-sdk import: rename SubscriptionUpdateProduct to CustomerSubscriptionUpdateProduct
Daoud Clarke5fb9543fb67e
diff --git a/mwmbl/platform/api.py b/mwmbl/platform/api.pyindex 27c70aa..05cb314 100644--- a/mwmbl/platform/api.py+++ b/mwmbl/platform/api.py@@ -10,7 +10,7 @@ from ninja.pagination import paginatefrom ninja_jwt.authentication import JWTAuthfrom polar_sdk import Polarfrom polar_sdk import models as polar_models-from polar_sdk.models import SubscriptionCancel, SubscriptionUpdateProduct+from polar_sdk.models import SubscriptionCancel, CustomerSubscriptionUpdateProductfrom polar_sdk.webhooks import validate_event, WebhookVerificationErrorfrom mwmbl.exceptions import InvalidRequest@@ -733,7 +733,7 @@ def change_plan(request, body: ChangePlanRequest):with Polar(access_token=settings.POLAR_ACCESS_TOKEN, server=settings.POLAR_SERVER) as polar:result = polar.subscriptions.update(id=billing.polar_subscription_id,- subscription_update=SubscriptionUpdateProduct(product_id=product_id),+ subscription_update=CustomerSubscriptionUpdateProduct(product_id=product_id),)billing.current_period_end = result.current_period_endbilling.save()diff --git a/pyproject.toml b/pyproject.tomlindex 3ccf455..3a286dc 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -45,7 +45,7 @@ dependencies = ["scalar-ninja>=0.3.0","django-background-tasks>=1.2.8","django-redis>=5.4.0",- "polar-sdk>=0.10.0",+ "polar-sdk==0.31.7","httpx>=0.27.0","defusedxml>=0.7.0",]