AccessCode.usable fixes
This commit is contained in:
parent
b5bf534ec3
commit
544db21261
|
@ -156,13 +156,13 @@ class AccessCode(models.Model):
|
||||||
return self.code
|
return self.code
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def usabe(self):
|
def usable(self):
|
||||||
# Check if active
|
# Check if active
|
||||||
if not self.active:
|
if not self.active:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Check if expired
|
# Check if expired
|
||||||
if timezone.now() >= self.expiration:
|
if self.expiration and (timezone.now() >= self.expiration):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Check if it someone already used it
|
# Check if it someone already used it
|
||||||
|
|
Reference in New Issue