zulip/corporate/views
Mateusz Mandera 834dbd552b remote_billing: Make handle_customer_migration_... more robust.
The logic in the case where there's only one realm and the function
tries to migrate the server's plan to it, had two main unhandled edge
cases that would throw exceptions:
1.
```
        remote_realm = RemoteRealm.objects.get(
            uuid=realm_uuids[0], plan_type=RemoteRealm.PLAN_TYPE_SELF_MANAGED
        )
```

This could throw an exception if the RemoteRealm exists, but has an
active e.g. Legacy plan. Then there'd be no object matching the
plan_type in the query, raising RemoteRealm.DoesNotExist.

2. If the RemoteRealm had e.g. a Legacy plan in the past, that's now
   expired, then it'd have a Customer object. Meaning that the attempt
   to move the server's customer to the realm:
   `server_plan.customer = remote_realm_customer`
   would trigger an IntegrityError since a RemoteRealm can't have two
   Customer objects.

In simple cases the situation in (2) can still be easily migrated, by
moving the plan from the server's customer to the realm's customer.
2024-02-20 16:02:03 -08:00
..
__init__.py
billing_page.py stripe: Extract method to get org_name. 2024-02-01 09:29:08 -08:00
event_status.py stripe: Fix $0 invoices being generated on upgrade. 2024-02-12 15:15:56 -08:00
installation_activity.py installation-activity: Fix ARR value in total row. 2024-02-20 15:57:06 -08:00
portico.py page_params: Parse page_params and state_data with Zod. 2024-02-17 00:02:38 -08:00
realm_activity.py remote-support: Add server data for last audit log update time. 2024-02-06 18:09:45 -08:00
remote_activity.py remote-activity: Fix broken support links. 2024-02-16 14:49:34 -08:00
remote_billing_page.py remote_billing: Make handle_customer_migration_... more robust. 2024-02-20 16:02:03 -08:00
session.py corporate: Remove '#nocoverage' comments. 2023-12-19 10:59:38 -08:00
sponsorship.py templates: Move billing templates to /templates/corporate/billing. 2024-01-30 10:06:48 -08:00
support.py support: Add button to delete configured fixed next plan. 2024-02-13 09:40:53 -08:00
upgrade.py templates: Move billing templates to /templates/corporate/billing. 2024-01-30 10:06:48 -08:00
user_activity.py remote-support: Add server data for last audit log update time. 2024-02-06 18:09:45 -08:00
webhook.py stripe: Fix $0 invoices being generated on upgrade. 2024-02-12 15:15:56 -08:00