mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 10:57:58 +00:00
support: Use shared template for current plan details on support views.
Moves the section in support views for any current plan details to a new template: `templates/analytics/current_plan_details.html`. Also, updates the PlanData dataclass to have a boolean that checks if the current plan tier is the self-hosted legacy plan.
This commit is contained in:
committed by
Tim Abbott
parent
771f8a3542
commit
d079a13760
@@ -18,6 +18,7 @@ class PlanData:
|
||||
current_plan: Optional["CustomerPlan"] = None
|
||||
licenses: Optional[int] = None
|
||||
licenses_used: Optional[int] = None
|
||||
is_legacy_plan: bool = False
|
||||
|
||||
|
||||
def get_support_url(realm: Realm) -> str:
|
||||
@@ -55,5 +56,9 @@ def get_current_plan_data_for_support_view(billing_session: BillingSession) -> P
|
||||
plan_data.current_plan = new_plan # nocoverage
|
||||
plan_data.licenses = last_ledger_entry.licenses
|
||||
plan_data.licenses_used = billing_session.current_count_for_billed_licenses()
|
||||
assert plan_data.current_plan is not None # for mypy
|
||||
plan_data.is_legacy_plan = (
|
||||
plan_data.current_plan.tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY
|
||||
)
|
||||
|
||||
return plan_data
|
||||
|
||||
Reference in New Issue
Block a user