From d1b4643b454e2d4740d553cb2de60f9d71690459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 6 Mar 2017 14:38:47 +0200 Subject: [PATCH] Obsolete --- hc/api/management/commands/pruneemails.py | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 hc/api/management/commands/pruneemails.py diff --git a/hc/api/management/commands/pruneemails.py b/hc/api/management/commands/pruneemails.py deleted file mode 100644 index 771cd86c..00000000 --- a/hc/api/management/commands/pruneemails.py +++ /dev/null @@ -1,14 +0,0 @@ -from datetime import timedelta - -from django.core.management.base import BaseCommand -from django.utils import timezone -from djmail.models import Message - - -class Command(BaseCommand): - help = 'Prune stored email messages older than 7 days' - - def handle(self, *args, **options): - cutoff = timezone.now() - timedelta(days=7) - n, _ = Message.objects.filter(sent_at__lt=cutoff).delete() - return "Done! Pruned %d email messages." % n