Skip to content

Commit

Permalink
Update models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxIsJoe committed Jan 18, 2024
1 parent 34743a4 commit bde9f50
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,8 @@ class PasswordResetRequestModel(models.Model):
account = models.ForeignKey(Account, on_delete=models.CASCADE)
created_at = models.DateTimeField(auto_now_add=True)

def __str__(self):
return f"{self.token} as {str(self.account)} created at {str(self.created_at)}"

def is_token_valid(self):
return timezone.now() <= timedelta(minutes=60)

0 comments on commit bde9f50

Please sign in to comment.