nonce: really fix cleanup in NonceManager

This commit is contained in:
Jérôme Schneider 2013-08-16 10:27:17 +02:00
parent 8b23e83e3c
commit fda9426fed
1 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import datetime as dt
from django.db import models
from django.utils.timezone import now
from django.utils import timezone
__all__ = ('Nonce',)
@ -9,8 +9,7 @@ _NONCE_LENGTH_CONSTANT = 256
class NonceManager(models.Manager):
def cleanup(self, now=None):
if not now:
now = now()
now = now or timezone.now()
self.filter(not_on_or_after__lt=now).delete()
class Nonce(models.Model):