From 59174694afd64b623b159eeec8fdb2afd7fc72db Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 13 Jul 2022 15:20:15 -0700 Subject: [PATCH] support: Skip corporate import unless BILLING_ENABLED. Signed-off-by: Anders Kaseorg --- analytics/views/support.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/analytics/views/support.py b/analytics/views/support.py index 5fc0a935f8..471459a8f3 100644 --- a/analytics/views/support.py +++ b/analytics/views/support.py @@ -17,7 +17,6 @@ from django.utils.translation import gettext as _ from confirmation.models import Confirmation, confirmation_url 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.realm_settings import ( do_change_realm_org_type, @@ -56,7 +55,12 @@ if settings.BILLING_ENABLED: update_sponsorship_status, 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: @@ -133,8 +137,8 @@ VALID_BILLING_METHODS = [ @dataclass class PlanData: - customer: Optional[Customer] = None - current_plan: Optional[CustomerPlan] = None + customer: Optional["Customer"] = None + current_plan: Optional["CustomerPlan"] = None licenses: Optional[int] = None licenses_used: Optional[int] = None