Voucher is_valid property
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user