Browse Source

Don't prune announcements and stickies.

Ralfp 12 years ago
parent
commit
24526bef56
1 changed files with 2 additions and 2 deletions
  1. 2 2
      misago/management/commands/pruneforums.py

+ 2 - 2
misago/management/commands/pruneforums.py

@@ -12,11 +12,11 @@ class Command(BaseCommand):
         for forum in Forum.objects.all():
             deleted = 0
             if forum.prune_start:
-                for thread in forum.thread_set.filter(start__lte=timezone.now() - timedelta(days=forum.prune_start)):
+                for thread in forum.thread_set.filter(weight=0).filter(start__lte=timezone.now() - timedelta(days=forum.prune_start)):
                     thread.delete()
                     deleted += 1
             if forum.prune_last:
-                for thread in forum.thread_set.filter(start__lte=timezone.now() - timedelta(days=forum.prune_last)):
+                for thread in forum.thread_set.filter(weight=0).filter(start__lte=timezone.now() - timedelta(days=forum.prune_last)):
                     thread.delete()
                     deleted += 1
             if deleted: