mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
populate_billing_realms: Add legacy remote realm.
This commit is contained in:
committed by
Tim Abbott
parent
b522ffa317
commit
fce50bb4a0
@@ -198,6 +198,11 @@ class Command(BaseCommand):
|
|||||||
is_sponsored=True,
|
is_sponsored=True,
|
||||||
is_remote_server=True,
|
is_remote_server=True,
|
||||||
),
|
),
|
||||||
|
CustomerProfile(
|
||||||
|
unique_id="legacy-remote-realm",
|
||||||
|
tier=CustomerPlan.TIER_SELF_HOSTED_LEGACY,
|
||||||
|
is_remote_realm=True,
|
||||||
|
),
|
||||||
CustomerProfile(
|
CustomerProfile(
|
||||||
unique_id="free-tier-remote-realm",
|
unique_id="free-tier-remote-realm",
|
||||||
is_remote_realm=True,
|
is_remote_realm=True,
|
||||||
@@ -553,7 +558,15 @@ def populate_remote_realms(customer_profile: CustomerProfile) -> Dict[str, str]:
|
|||||||
else:
|
else:
|
||||||
customer = billing_session.update_or_create_customer()
|
customer = billing_session.update_or_create_customer()
|
||||||
add_card_to_customer(customer)
|
add_card_to_customer(customer)
|
||||||
if customer_profile.tier is not None:
|
if customer_profile.tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY:
|
||||||
|
renewal_date = datetime.strptime(customer_profile.renewal_date, TIMESTAMP_FORMAT).replace(
|
||||||
|
tzinfo=timezone.utc
|
||||||
|
)
|
||||||
|
end_date = datetime.strptime(customer_profile.end_date, TIMESTAMP_FORMAT).replace(
|
||||||
|
tzinfo=timezone.utc
|
||||||
|
)
|
||||||
|
billing_session.migrate_customer_to_legacy_plan(renewal_date, end_date)
|
||||||
|
elif customer_profile.tier is not None:
|
||||||
billing_session.do_change_plan_type(
|
billing_session.do_change_plan_type(
|
||||||
tier=customer_profile.tier, is_sponsored=customer_profile.is_sponsored
|
tier=customer_profile.tier, is_sponsored=customer_profile.is_sponsored
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user