add ability to have non-expiring nonces, clean up expired nonces

This commit is contained in:
Jens Langhammer
2019-04-04 21:49:10 +02:00
parent a21012bf0c
commit 660972e303
5 changed files with 33 additions and 2 deletions

View File

@ -437,6 +437,7 @@ class Nonce(UUIDModel):
expires = models.DateTimeField(default=default_nonce_duration)
user = models.ForeignKey('User', on_delete=models.CASCADE)
expiring = models.BooleanField(default=True)
def __str__(self):
return "Nonce %s (expires=%s)" % (self.uuid.hex, self.expires)