corporate: Create VALID_BILLING_SCHEDULE_VALUES in views.py.

This commit is contained in:
Vishnu KS 2021-04-09 16:06:46 +05:30 committed by Tim Abbott
parent ef1b3a4067
commit 760a3861e1
1 changed files with 2 additions and 1 deletions

View File

@ -52,6 +52,7 @@ from zerver.models import UserProfile, get_realm
billing_logger = logging.getLogger("corporate.stripe")
VALID_BILLING_MODALITY_VALUES = ["send_invoice", "charge_automatically"]
VALID_BILLING_SCHEDULE_VALUES = ["annual", "monthly"]
VALID_LICENSE_MANAGEMENT_VALUES = ["automatic", "manual"]
@ -72,7 +73,7 @@ def check_upgrade_parameters(
) -> None:
if billing_modality not in VALID_BILLING_MODALITY_VALUES:
raise BillingError("unknown billing_modality")
if schedule not in ["annual", "monthly"]:
if schedule not in VALID_BILLING_SCHEDULE_VALUES:
raise BillingError("unknown schedule")
if license_management not in VALID_LICENSE_MANAGEMENT_VALUES:
raise BillingError("unknown license_management")