Voucher is_valid property

This commit is contained in:
2020-10-04 22:12:44 +02:00
parent ae915681ac
commit ab3ecae54b
3 changed files with 139 additions and 0 deletions

View File

@@ -49,6 +49,10 @@ class Voucher(Expireable):
"""
code = models.CharField(unique=True, max_length=30)
@property
def valid(self):
return not self.is_expired
def __str__(self):
return "Voucher " + str(self.code)