From 544db21261639e7c643ee3ad3091a031e5903b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Marti=CC=81n?= Date: Mon, 26 Jan 2015 14:35:58 +0100 Subject: [PATCH] AccessCode.usable fixes --- shelfzilla/apps/account/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shelfzilla/apps/account/models.py b/shelfzilla/apps/account/models.py index ce27a28..75faeb4 100644 --- a/shelfzilla/apps/account/models.py +++ b/shelfzilla/apps/account/models.py @@ -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