support: Show customer plan details in support page.

This commit is contained in:
Vishnu KS
2020-07-03 23:51:13 +05:30
committed by Tim Abbott
parent f6cbb9177a
commit 1a1396d07e
5 changed files with 64 additions and 3 deletions

View File

@@ -74,6 +74,14 @@ class CustomerPlan(models.Model):
CustomerPlan.ENTERPRISE: 'Zulip Enterprise',
}[self.tier]
def get_plan_status_as_text(self) -> str:
return {
self.ACTIVE: "Active",
self.DOWNGRADE_AT_END_OF_CYCLE: "Scheduled for downgrade at end of cycle",
self.FREE_TRIAL: "Free trial",
self.ENDED: "Ended",
self.NEVER_STARTED: "Never started"
}[self.status]
def get_current_plan_by_customer(customer: Customer) -> Optional[CustomerPlan]:
return CustomerPlan.objects.filter(