aboutsummaryrefslogtreecommitdiffstats
path: root/alphabetlearning/payments/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'alphabetlearning/payments/models.py')
-rw-r--r--alphabetlearning/payments/models.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/alphabetlearning/payments/models.py b/alphabetlearning/payments/models.py
index ce5c8aa..9ea9de2 100644
--- a/alphabetlearning/payments/models.py
+++ b/alphabetlearning/payments/models.py
@@ -1,8 +1,10 @@
import uuid
+from datetime import timedelta
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
+from django.utils import timezone
from alphabetlearning.resources.models import Resource
@@ -13,6 +15,11 @@ class EmailVerification(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
is_verified = models.BooleanField(default=False)
+ @property
+ def is_expired(self):
+ expiration_time = timedelta(hours=26)
+ return timezone.now() - self.created_at > expiration_time
+
def __str__(self):
return f"Email verification for {self.email}"