fmartingr
/
shelfzilla
Archived
1
0
Fork 0

AccessCode.usable fixes

This commit is contained in:
Felipe Martín 2015-01-26 14:35:58 +01:00
parent b5bf534ec3
commit 544db21261
1 changed files with 2 additions and 2 deletions

View File

@ -156,13 +156,13 @@ class AccessCode(models.Model):
return self.code
@property
def usabe(self):
def usable(self):
# Check if active
if not self.active:
return False
# Check if expired
if timezone.now() >= self.expiration:
if self.expiration and (timezone.now() >= self.expiration):
return False
# Check if it someone already used it