mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	stripe: Disable free trial for self hosted customers.
This commit is contained in:
		@@ -1143,6 +1143,10 @@ class BillingSession(ABC):
 | 
			
		||||
        assert customer.stripe_customer_id is not None  # for mypy
 | 
			
		||||
        self.ensure_current_plan_is_upgradable(customer, plan_tier)
 | 
			
		||||
        billing_cycle_anchor = None
 | 
			
		||||
 | 
			
		||||
        if remote_server_legacy_plan is not None:  # nocoverage
 | 
			
		||||
            # Legacy servers don't get an additional free trial.
 | 
			
		||||
            free_trial = False
 | 
			
		||||
        if should_schedule_upgrade_for_legacy_remote_server:  # nocoverage
 | 
			
		||||
            assert remote_server_legacy_plan is not None
 | 
			
		||||
            billing_cycle_anchor = remote_server_legacy_plan.end_date
 | 
			
		||||
 
 | 
			
		||||
@@ -149,6 +149,9 @@ def remote_realm_plans_page(
 | 
			
		||||
        if context.customer_plan is None:
 | 
			
		||||
            context.on_free_tier = not context.is_sponsored
 | 
			
		||||
        else:
 | 
			
		||||
            if context.customer_plan.tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY:
 | 
			
		||||
                # Free trial is disabled for legacy customers.
 | 
			
		||||
                context.free_trial_days = None
 | 
			
		||||
            context.on_free_tier = context.customer_plan.tier in (
 | 
			
		||||
                CustomerPlan.TIER_SELF_HOSTED_LEGACY,
 | 
			
		||||
                CustomerPlan.TIER_SELF_HOSTED_BASE,
 | 
			
		||||
@@ -198,6 +201,9 @@ def remote_server_plans_page(
 | 
			
		||||
        if context.customer_plan is None:
 | 
			
		||||
            context.on_free_tier = not context.is_sponsored
 | 
			
		||||
        else:
 | 
			
		||||
            if context.customer_plan.tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY:
 | 
			
		||||
                # Free trial is disabled for legacy customers.
 | 
			
		||||
                context.free_trial_days = None
 | 
			
		||||
            context.on_free_tier = context.customer_plan.tier in (
 | 
			
		||||
                CustomerPlan.TIER_SELF_HOSTED_LEGACY,
 | 
			
		||||
                CustomerPlan.TIER_SELF_HOSTED_BASE,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user