From 3b0b5f464ebef6a518b279d5fe28a6c823911275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Fri, 29 Nov 2024 14:47:00 +0100 Subject: [PATCH] Fix old name in plan decoding --- app/account_linking.py | 8 ++++---- app/proton/proton_client.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/account_linking.py b/app/account_linking.py index bd66a95eb..ee22f284e 100644 --- a/app/account_linking.py +++ b/app/account_linking.py @@ -91,7 +91,7 @@ def set_plan_for_partner_user(partner_user: PartnerUser, plan: SLPlan): end_time = None if sub is None: LOG.i( - f"Creating partner_subscription [user_id={partner_user.user_id}] [partner_id={partner_user.partner_id}]" + f"Creating partner_subscription [user_id={partner_user.user_id}] [partner_id={partner_user.partner_id}] with {end_time} / {is_lifetime}" ) create_partner_subscription( partner_user=partner_user, @@ -102,14 +102,14 @@ def set_plan_for_partner_user(partner_user: PartnerUser, plan: SLPlan): agent.record_custom_event("PlanChange", {"plan": "premium", "type": "new"}) else: if sub.end_at != plan.expiration or sub.lifetime != is_lifetime: - LOG.i( - f"Updating partner_subscription [user_id={partner_user.user_id}] [partner_id={partner_user.partner_id}]" - ) agent.record_custom_event( "PlanChange", {"plan": "premium", "type": "extension"} ) sub.end_at = plan.expiration if not is_lifetime else None sub.lifetime = is_lifetime + LOG.i( + f"Updating partner_subscription [user_id={partner_user.user_id}] [partner_id={partner_user.partner_id}] to {sub.end_at} / {sub.lifetime} " + ) emit_user_audit_log( user=partner_user.user, action=UserAuditLogAction.SubscriptionExtended, diff --git a/app/proton/proton_client.py b/app/proton/proton_client.py index 8c086ec8e..b4f4d256f 100644 --- a/app/proton/proton_client.py +++ b/app/proton/proton_client.py @@ -113,7 +113,7 @@ def get_user(self) -> Optional[UserInformation]: if plan_value == PLAN_FREE: plan = SLPlan(type=SLPlanType.Free, expiration=None) elif plan_value == PLAN_PREMIUM: - expiration = info.get("Expiration", "1") + expiration = info.get("PlanExpiration", "1") plan = SLPlan( type=SLPlanType.Premium, expiration=Arrow.fromtimestamp(expiration, tzinfo="utc"),