Files
zulip/zerver/management/commands/archive_messages.py
K.Kanakhin e930851d16 retention-period: Add more core code for retention policy.
This is a very old commit for #106, which has been on hiatus for a few
years.  It was significantly modified by tabbott to:
* Improve coding style and variable names
* Update mypy annotations style
* Clean up the testing logic
* Update for API changes elsewhere in our system

But the actual runtime code is essentially unmodified from the
original work by Kirill.

It contains basic support for archiving Messages, UserMessages, and
Attachments with a nice test suite.  It's still not usable in
production (e.g. it will probably break Reactions, SubMessages, etc.),
but upcoming commits will address that.
2019-05-19 20:22:47 -07:00

13 lines
282 B
Python

from __future__ import absolute_import
from typing import Any
from django.core.management.base import BaseCommand
from zerver.lib.retention import archive_messages
class Command(BaseCommand):
def handle(self, *args: Any, **options: str) -> None:
archive_messages()