realm: Rename plan type constants to be more descriptive.

It is confusing to have the plan type constants not be namespaced
by the thing they represent. We already have a namespacing
convention in place for constants, so we should use it for
Realm.plan_type as well.
This commit is contained in:
Eeshan Garg
2021-10-18 17:28:17 -04:00
committed by Tim Abbott
parent cbbd4b128d
commit b325a4f1be
25 changed files with 141 additions and 131 deletions

View File

@@ -282,7 +282,7 @@ def fetch_initial_state_data(
state["realm_is_zephyr_mirror_realm"] = realm.is_zephyr_mirror_realm
state["development_environment"] = settings.DEVELOPMENT
state["realm_plan_type"] = realm.plan_type
state["zulip_plan_is_not_limited"] = realm.plan_type != Realm.LIMITED
state["zulip_plan_is_not_limited"] = realm.plan_type != Realm.PLAN_TYPE_LIMITED
state["upgrade_text_for_wide_organization_logo"] = str(Realm.UPGRADE_TEXT_STANDARD)
state["password_min_length"] = settings.PASSWORD_MIN_LENGTH
@@ -944,7 +944,7 @@ def apply_event(
if event["property"] == "plan_type":
# Then there are some extra fields that also need to be set.
state["zulip_plan_is_not_limited"] = event["value"] != Realm.LIMITED
state["zulip_plan_is_not_limited"] = event["value"] != Realm.PLAN_TYPE_LIMITED
state["realm_upload_quota_mib"] = event["extra_data"]["upload_quota"]
policy_permission_dict = {