corporate: Create VALID_LICENSE_MANAGEMENT_VALUES in views.py.

This commit is contained in:
Vishnu KS 2021-04-09 14:44:05 +05:30 committed by Tim Abbott
parent 98ec84eae2
commit 6db6fab5ff
1 changed files with 3 additions and 1 deletions

View File

@ -51,6 +51,8 @@ from zerver.models import UserProfile, get_realm
billing_logger = logging.getLogger("corporate.stripe") billing_logger = logging.getLogger("corporate.stripe")
VALID_LICENSE_MANAGEMENT_VALUES = ["automatic", "manual"]
def unsign_seat_count(signed_seat_count: str, salt: str) -> int: def unsign_seat_count(signed_seat_count: str, salt: str) -> int:
try: try:
@ -71,7 +73,7 @@ def check_upgrade_parameters(
raise BillingError("unknown billing_modality") raise BillingError("unknown billing_modality")
if schedule not in ["annual", "monthly"]: if schedule not in ["annual", "monthly"]:
raise BillingError("unknown schedule") raise BillingError("unknown schedule")
if license_management not in ["automatic", "manual"]: if license_management not in VALID_LICENSE_MANAGEMENT_VALUES:
raise BillingError("unknown license_management") raise BillingError("unknown license_management")
if billing_modality == "charge_automatically": if billing_modality == "charge_automatically":