mirror of https://github.com/zulip/zulip.git
834dbd552b
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. |
||
---|---|---|
.. | ||
lib | ||
management | ||
migrations | ||
tests | ||
views | ||
__init__.py | ||
models.py | ||
urls.py |