corporate: Fix 'free_trial=True` for legacy customers during upgrade.

Earlier, we were not setting `free_trial` = False for legacy
customers in `do_upgrade`.

This lead to a bug where customers were upgraded even before the
payment was complete. 'process_initial_upgrade' was always getting
called instead of 'setup_upgrade_payment_intent_and_charge'.

This commit fixes the incorrect behaviour.
This commit is contained in:
Prakhar Pratyush
2024-02-12 15:39:45 +05:30
committed by Tim Abbott
parent d3b5a76a67
commit a764f9ce25

View File

@@ -1736,6 +1736,9 @@ class BillingSession(ABC):
free_trial = False
remote_server_legacy_plan = self.get_remote_server_legacy_plan(customer)
if remote_server_legacy_plan is not None:
# Free trial is not available for legacy customers.
free_trial = False
should_schedule_upgrade_for_legacy_remote_server = (
remote_server_legacy_plan is not None
and upgrade_request.remote_server_plan_start_date == "billing_cycle_end_date"