2013-04-23 18:51:17 +02:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2012-11-28 01:06:05 +01:00
|
|
|
from django.core.management.base import BaseCommand
|
2013-07-29 23:03:31 +02:00
|
|
|
from zerver.retention_policy import get_UserMessages_to_expunge
|
|
|
|
from zerver.models import Message
|
2012-11-28 01:06:05 +01:00
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
help = ('Expunge old UserMessages and Messages from the database, '
|
|
|
|
+ 'according to the retention policy.')
|
|
|
|
|
|
|
|
def handle(self, *args, **kwargs):
|
|
|
|
get_UserMessages_to_expunge().delete()
|
|
|
|
Message.remove_unreachable()
|