Browse Source

Obsolete

pull/117/head
Pēteris Caune 8 years ago
parent
commit
d1b4643b45
1 changed files with 0 additions and 14 deletions
  1. +0
    -14
      hc/api/management/commands/pruneemails.py

+ 0
- 14
hc/api/management/commands/pruneemails.py View File

@ -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

Loading…
Cancel
Save