support: Skip corporate import unless BILLING_ENABLED.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-07-13 15:20:15 -07:00
parent 4b8556ed13
commit 59174694af
1 changed files with 8 additions and 4 deletions

View File

@ -17,7 +17,6 @@ from django.utils.translation import gettext as _
from confirmation.models import Confirmation, confirmation_url from confirmation.models import Confirmation, confirmation_url
from confirmation.settings import STATUS_ACTIVE from confirmation.settings import STATUS_ACTIVE
from corporate.models import Customer, CustomerPlan
from zerver.actions.create_realm import do_change_realm_subdomain from zerver.actions.create_realm import do_change_realm_subdomain
from zerver.actions.realm_settings import ( from zerver.actions.realm_settings import (
do_change_realm_org_type, do_change_realm_org_type,
@ -56,7 +55,12 @@ if settings.BILLING_ENABLED:
update_sponsorship_status, update_sponsorship_status,
void_all_open_invoices, void_all_open_invoices,
) )
from corporate.models import get_current_plan_by_realm, get_customer_by_realm from corporate.models import (
Customer,
CustomerPlan,
get_current_plan_by_realm,
get_customer_by_realm,
)
def get_plan_name(plan_type: int) -> str: def get_plan_name(plan_type: int) -> str:
@ -133,8 +137,8 @@ VALID_BILLING_METHODS = [
@dataclass @dataclass
class PlanData: class PlanData:
customer: Optional[Customer] = None customer: Optional["Customer"] = None
current_plan: Optional[CustomerPlan] = None current_plan: Optional["CustomerPlan"] = None
licenses: Optional[int] = None licenses: Optional[int] = None
licenses_used: Optional[int] = None licenses_used: Optional[int] = None