|
@@ -1,5 +1,6 @@
|
|
|
from django.core.management.base import BaseCommand
|
|
|
from django.utils import timezone
|
|
|
+from misago.core import cachebuster
|
|
|
from misago.users.models import BanCache
|
|
|
|
|
|
|
|
@@ -22,4 +23,9 @@ class Command(BaseCommand):
|
|
|
queryset = queryset.filter(valid_until__lte=timezone.now().date())
|
|
|
|
|
|
expired_count = queryset.delete()
|
|
|
+
|
|
|
+ bans_version = get_version('misago_bans')
|
|
|
+ queryset = BanCache.objects.filter(bans_version__lt=bans_version)
|
|
|
+ expired_count += queryset.delete()
|
|
|
+
|
|
|
self.stdout.write('Ban caches emptied: %s' expired_count)
|