Skip to content

Commit

Permalink
Fix old name in plan decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
acasajus committed Nov 29, 2024
1 parent 6b21273 commit 3b0b5f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/account_linking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/proton/proton_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 3b0b5f4

Please sign in to comment.