diff --git a/confirmation/models.py b/confirmation/models.py index daa1cd1af6..a8720a23f3 100644 --- a/confirmation/models.py +++ b/confirmation/models.py @@ -40,12 +40,11 @@ class ConfirmationManager(models.Manager): confirmation = self.get(confirmation_key=confirmation_key) except self.model.DoesNotExist: return False - if not confirmation.key_expired(): - obj = confirmation.content_object - status_field = get_status_field(obj._meta.app_label, obj._meta.module_name) - setattr(obj, status_field, getattr(settings, 'STATUS_ACTIVE', 1)) - obj.save() - return obj + obj = confirmation.content_object + status_field = get_status_field(obj._meta.app_label, obj._meta.module_name) + setattr(obj, status_field, getattr(settings, 'STATUS_ACTIVE', 1)) + obj.save() + return obj return False def send_confirmation(self, obj, email_address): @@ -75,11 +74,6 @@ class ConfirmationManager(models.Manager): send_mail(subject, body, settings.DEFAULT_FROM_EMAIL, [email_address]) return self.create(content_object=obj, date_sent=datetime.datetime.now(), confirmation_key=confirmation_key) - def delete_expired_confirmations(self): - for confirmation in self.all(): - if confirmation.key_expired(): - confirmation.delete() - class Confirmation(models.Model): content_type = models.ForeignKey(ContentType) @@ -96,8 +90,3 @@ class Confirmation(models.Model): def __unicode__(self): return _('confirmation email for %s') % self.content_object - - def key_expired(self): - expiration_date = self.date_sent + datetime.timedelta(days=getattr(settings, 'EMAIL_CONFIRMATION_DAYS', 10)) - return expiration_date <= datetime.datetime.now() - key_expired.boolean = True diff --git a/confirmation/settings.py b/confirmation/settings.py index 8544123bce..a5a9a09204 100644 --- a/confirmation/settings.py +++ b/confirmation/settings.py @@ -4,8 +4,6 @@ __revision__ = '$Id: settings.py 12 2008-11-23 19:38:52Z jarek.zgoda $' -EMAIL_CONFIRMATION_DAYS = 10 - STATUS_ACTIVE = 1 STATUS_FIELDS = {