Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

populate_billing_realms: Simulate 2 months free trial.

Aman Agrawal9594e635cd60
diff --git a/zilencer/management/commands/populate_billing_realms.py b/zilencer/management/commands/populate_billing_realms.py
index a071db5d834..22b1fda330e 100644
--- a/zilencer/management/commands/populate_billing_realms.py
+++ b/zilencer/management/commands/populate_billing_realms.py
@@ -271,10 +271,14 @@ def add_card_to_customer(customer: Customer) -> None:
def create_plan_for_customer(customer: Customer, customer_profile: CustomerProfile) -> None:
assert customer_profile.tier is not None
- months = 12
- if customer_profile.billing_schedule == CustomerPlan.BILLING_SCHEDULE_MONTHLY:
- months = 1
- next_invoice_date = add_months(timezone_now(), months)
+ if customer_profile.status == CustomerPlan.FREE_TRIAL:
+ # 2 months free trial.
+ next_invoice_date = add_months(timezone_now(), 2)
+ else:
+ months = 12
+ if customer_profile.billing_schedule == CustomerPlan.BILLING_SCHEDULE_MONTHLY:
+ months = 1
+ next_invoice_date = add_months(timezone_now(), months)
customer_plan = CustomerPlan.objects.create(
customer=customer,