mirror of https://github.com/zulip/zulip.git
corporate: Revise string method for LicenseLedger objects.
Includes the license counts, date and renewal information as well as the id field, so that print debugging and displaying these objects is easier and more useful.
This commit is contained in:
parent
333eedb351
commit
e86c02cd67
|
@ -538,6 +538,12 @@ class LicenseLedger(models.Model):
|
||||||
# equal to the number of activated users in the organization.
|
# equal to the number of activated users in the organization.
|
||||||
licenses_at_next_renewal = models.IntegerField(null=True)
|
licenses_at_next_renewal = models.IntegerField(null=True)
|
||||||
|
|
||||||
|
@override
|
||||||
|
def __str__(self) -> str:
|
||||||
|
ledger_type = "renewal" if self.is_renewal else "update"
|
||||||
|
ledger_time = self.event_time.strftime("%Y-%m-%d %H:%M")
|
||||||
|
return f"License {ledger_type}, {self.licenses} purchased, {self.licenses_at_next_renewal} next cycle, {ledger_time} (id={self.id})"
|
||||||
|
|
||||||
|
|
||||||
class SponsoredPlanTypes(Enum):
|
class SponsoredPlanTypes(Enum):
|
||||||
# unspecified used for cloud sponsorship requests
|
# unspecified used for cloud sponsorship requests
|
||||||
|
|
Loading…
Reference in New Issue